-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into TypoMolecConseq
- Loading branch information
Showing
28 changed files
with
271 additions
and
237 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
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
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
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,23 @@ | ||
from pathlib import Path | ||
from pyfastx import Fasta | ||
from urllib.request import urlretrieve | ||
|
||
|
||
def download_fasta(): | ||
try: | ||
# Make sure the parent folder exists | ||
Path('FASTA').mkdir(exist_ok=True) | ||
|
||
for build in ['GRCh37', 'GRCh38']: | ||
filename = build + '_latest_genomic.fna.gz' | ||
filepath = 'FASTA/' + filename | ||
|
||
# Download files | ||
if not Path(filepath).is_file(): | ||
urlretrieve('https://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/annotation/' + build + '_latest/refseq_identifiers/' + filename, filepath) | ||
|
||
# Build indexes | ||
if not Path(filepath + '.fxi').is_file(): | ||
Fasta(filepath) | ||
except Exception as error: | ||
print(error) |
Oops, something went wrong.