2
$\begingroup$

Say I want to use wget to download a gff file for the X chromosome of release 5.57 of the Drosophila melanogaster genome. The NCBI page with the gff file for just this is here.

However, I do not see any way to directly wget the gff from this page. What I can do is click "Send to" at the top, select File, and change the Format dropdown to GFF3, and finally click 'Create File', and the gff file downloads onto my computer.

But then I lose the ability to use the -a flag to log the download details, I can't download the gff using wget from a remote server directly but instead I need to download it locally and then upload it, etc. Is there any way to use wget to download gff files from NCBI programmatically instead of having to download it manually from the website?

$\endgroup$
2
  • $\begingroup$ Are you looking for these? $\endgroup$
    – user172818
    Nov 20, 2022 at 17:44
  • 1
    $\begingroup$ @user172818 If you mean my example, not exactly, I'm looking for release a 5.57 gff based on chromosome X, that link lets me download a release 6 whole genome gff. But I think I figured out what to do, and I posted an answer to my question. $\endgroup$
    – arara
    Nov 20, 2022 at 21:18

2 Answers 2

3
$\begingroup$

my suggestion would be to go via the assembly page. For your example link, I would

  1. Click the link to the BioProject: PRJNA164
  2. On the right side, under "Related information" choose the assembly
  3. On the assembly page, under "Access the data" on the right side, I would choose "FTP directory for RefSeq assembly"

Once in the RefSeq folder, copy the link to the *_genomic.gff.gz and use wget.

wget https://ftp.ncbi.nlm.nih.gov/genomes/all/GCF/000/001/215/GCF_000001215.4_Release_6_plus_ISO1_MT/GCF_000001215.4_Release_6_plus_ISO1_MT_genomic.gff.gz

Edit: The initial question requested an older versions, which can be found in RefSeq's archive of prior releases. For this specific Drosophila assembly chromosome X, the version 5 can be found at https://ftp.ncbi.nlm.nih.gov/genomes/archive/old_refseq/Drosophila_melanogaster/RELEASE_5/CHR_X/NC_004354.gff

$\endgroup$
4
  • $\begingroup$ This does show how to wget from NCBI, although it wouldn't work on the specific case I mentioned. This gives me the whole genome, although I'm curious on getting a single chromosome. Also it will give me release 6 (the latest one), whereas my scenario was for release 5. However I think I found a way to do this. $\endgroup$
    – arara
    Nov 20, 2022 at 21:12
  • $\begingroup$ Pardon, the RefSeq archive seems what you are looking for. Have a look at ftp.ncbi.nlm.nih.gov/genomes/archive/old_refseq/…. The path to the X chromosome's gff should be straight forward. ftp.ncbi.nlm.nih.gov/genomes/archive/old_refseq/… $\endgroup$ Nov 21, 2022 at 7:32
  • $\begingroup$ That's exactly it! Could you edit these links into your main answer so I can mark your comment as accepted? $\endgroup$
    – arara
    Nov 21, 2022 at 21:09
  • $\begingroup$ You're welcome. Glad to have helped $\endgroup$ Nov 22, 2022 at 9:20
1
$\begingroup$

I believe I figured out a way to do this for my particular example (although in general cases Adrian's answer works). To get release 5.57 (an earlier release) of chromosome X of Drosophila melanogaster, I believe you can go to the Datasets Genome page of D. melanogaster, scroll down to the Revision History and select Release 5, and at the top of the page, NCBI lets you click on a 'datasets' or 'curl' box to copy the exact command line argument needed to download a GFF (and other files) of that whole genome. Then, I believe it should be possible to open the gff in Python using a package like gffutils, and filter only for chromosome X rows, and then write those rows to a new gff file.

$\endgroup$
2
  • 1
    $\begingroup$ If you are willing to filter, there is no need for python or writing a whole script. A simple grep -P '^NC_004354.3\t' foo.gff > chrX.gff will do. $\endgroup$
    – terdon
    Nov 21, 2022 at 10:25
  • $\begingroup$ Did not realize I could do that, thanks. Although you'd probably have to add a bit to this command to also preserve the header lines. Maybe (grep "^#" foo.gff; grep -P '^NC_004354.3\t' foo.gff) > chrX.gff $\endgroup$
    – arara
    Nov 21, 2022 at 21:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.