-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add rna_alignment/rna_align_fetch_cm.py rna_align_fetch_seed.py
- Loading branch information
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
""" | ||
from __future__ import print_function | ||
import argparse | ||
from icecream import ic | ||
import sys | ||
ic.configureOutput(outputFunction=lambda *a: print(*a, file=sys.stderr)) | ||
ic.configureOutput(prefix='> ') | ||
import requests | ||
|
||
|
||
def get_parser(): | ||
parser = argparse.ArgumentParser( | ||
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) | ||
|
||
#parser.add_argument('-', "--", help="", default="") | ||
|
||
parser.add_argument("-v", "--verbose", | ||
action="store_true", help="be verbose") | ||
parser.add_argument("family", help="", default="", nargs='+') | ||
return parser | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = get_parser() | ||
args = parser.parse_args() | ||
|
||
if list != type(args.family): | ||
args.family = [args.family] | ||
|
||
for family in args.family: | ||
|
||
# URL of the Rfam seed alignment | ||
url = f"https://rfam.org/family/{family}/cm" | ||
|
||
# Output file name | ||
output_file = f"{family}.cm" | ||
|
||
# Download the file | ||
response = requests.get(url) | ||
if response.status_code == 200: | ||
with open(output_file, "wb") as f: | ||
f.write(response.content) | ||
print(f"Downloaded model saved as {output_file}") | ||
else: | ||
print(f"Failed to download. Status code: {response.status_code}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
""" | ||
""" | ||
from __future__ import print_function | ||
import argparse | ||
from icecream import ic | ||
import sys | ||
ic.configureOutput(outputFunction=lambda *a: print(*a, file=sys.stderr)) | ||
ic.configureOutput(prefix='> ') | ||
import requests | ||
|
||
|
||
def get_parser(): | ||
parser = argparse.ArgumentParser( | ||
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) | ||
|
||
#parser.add_argument('-', "--", help="", default="") | ||
|
||
parser.add_argument("-v", "--verbose", | ||
action="store_true", help="be verbose") | ||
parser.add_argument("family", help="", default="", nargs='+') | ||
return parser | ||
|
||
|
||
if __name__ == '__main__': | ||
parser = get_parser() | ||
args = parser.parse_args() | ||
|
||
if list != type(args.family): | ||
args.family = [args.family] | ||
|
||
for family in args.family: | ||
|
||
# URL of the Rfam seed alignment | ||
url = f"https://rfam.org/family/{family}/alignment/fastau" | ||
|
||
# Output file name | ||
output_file = f"{family}.seed.sto" | ||
|
||
# Download the file | ||
response = requests.get(url) | ||
if response.status_code == 200: | ||
with open(output_file, "wb") as f: | ||
f.write(response.content) | ||
print(f"Downloaded seed alignment saved as {output_file}") | ||
else: | ||
print(f"Failed to download. Status code: {response.status_code}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters