Skip to main content
10 votes
Accepted

Importing GFF file with Biopython

No, there is currently no GFF support in biopython. However, you can read in GFF files into python using this package, gffutils. There are also a few other packages to read/write GFF files, like <...
conchoecia's user avatar
  • 3,181
6 votes
Accepted

How to extract the protein fasta file from a genbank file?

One can get it to work by using SeqIO.InsdcIO.GenBankCdsFeatureIterator: ...
Cleb's user avatar
  • 743
5 votes
Accepted

Entrez.efetch returns incomplete genbank records

This has been answered before. See: https://stackoverflow.com/a/55402322/6262370 In short, you need to either use rettype='gbwithparts' or ...
vkkodali's user avatar
  • 1,266
3 votes
Accepted

KeyError when getting features from a genbank file with biopython with some accessions but not others

Good question. feature.qualifiers is a dict, if the dict doesn't have that key it will throw a KeyError. The way your code works it expects feature.qualifiers to have 'gene' as a key every time ...
Liam McIntyre's user avatar
3 votes

Existing tool for converting gff3 to genbank (gbk)

I believe seqret is already the simplest approach. If you install the emboss command line utility, genome (file) sizes will not be a problem. You can even install ...
Felipe Almeida's user avatar
3 votes

Genomics: Downloading genomic data from the NCBI Genbank database

For downloading data from commandline use the E-utilities of NCBI.
WYSIWYG's user avatar
  • 263
3 votes

How to get the product of a CDS

If you change the delimiter to something besides a space in the tr command (tr "\"" "\t") then you can use that same delimiter ...
Bioathlete's user avatar
  • 2,574
3 votes
Accepted

What does this accession NCBI code mean: 6MWN_B?

In general, an accession is a value that points to (provides access to) a single database entry. Different databases (GenBank, RefSeq, Ensembl, SwissProt, and so on) have different conventions for ...
Daniel Standage's user avatar
2 votes

Importing GFF file with Biopython

I would use BCBio for gff handling as it is written to directly interface with BioPython’s object model. The only downside is that I believe it is no longer ...
Joe Healey's user avatar
2 votes
Accepted

How to programmatically classify a protein according to its genbank feature

Using the UniProt website API (https://www.uniprot.org/help/api) this could be done with a query like https://www.uniprot.org/uniprot/?query=name%3A%22type%20IV%20secretion%20protein%20Rhs%22&...
Elisabeth.Gasteiger's user avatar
2 votes
Accepted

Convert sequence in MS doc to fasta or genbank

The CrazyDoc Python package can convert Genbank/Fasta/Snapgene/MSDoc sequences into Biopython records, which can be saved as Genbank or Fasta. A web interface / demo is provided at EGF CUBA (...
Peter's user avatar
  • 2,634
2 votes
Accepted

Why does the Genbank phylogenetic tree of 4000 sars-cov-2 sequences only display 200 nodes?

Okay, I'll provide a formal answer, Genbank phylogeny is to get a gist of the diversity. It isn't a formal phylogenetic analysis. You can down the tree as a pdf, I don't think you can download the ...
M__'s user avatar
  • 12.6k
2 votes
Accepted

Entrez (Biopython) esearch and efetch not returning sequence as expected

Did you try to fetch from the database nucleotide instead of gene ? ...
Pierre-Edouard Guerin's user avatar
2 votes

How to programatically download SARS-CoV-2 fasta from NCBI/Genbank via API?

In the efetch.fcgi URL, you can set rettype=fasta to download the nucleotide sequence or ...
nisetama's user avatar
  • 121
2 votes

How to programatically download SARS-CoV-2 fasta from NCBI/Genbank via API?

You can try the NCBI Datasets API. We have an endpoint that would allow you to download virus sequences by accession The only thing to be aware (based on your list of accessions) is that our API ...
MirianT's user avatar
  • 21
2 votes
Accepted

How to programatically download SARS-CoV-2 fasta from NCBI/Genbank via API?

You can get the data from the API of the European Nucleotide Archive (ENA) which is synched with NCBI/GenBank: https://www.ebi.ac.uk/ena/browser/api/fasta/MZ039713,MZ039682,OV522182
CC.'s user avatar
  • 136
2 votes

Parsing a genbank file and outputting specific feature information to a csv using BioPython

Depending on which field you want to pull the "scaffold_31" text from, you have a few options: GenBank Text BioPython object LOCUS ...
Jesse's user avatar
  • 947
2 votes
Accepted

Get genome coordinates from UniProt entry?

You don't want the EU968504, that's the mRNA not the genome sequence. You want https://www.ncbi.nlm.nih.gov/nuccore/CM007647, also linked to from the UniProt page, just under the link to EU968504: ...
terdon's user avatar
  • 10.2k
2 votes
Accepted

How to reverse complement a genbank file?

I have not really used Mauve, so I don't know whether it might have an in-built setting for that. SnapGene Viewer should be able to do that - it can open genbank files and export them, and View > ...
Laura's user avatar
  • 937
2 votes

What is the best Query to retrieve DNA from NCBI?

There are two main problems I can see in your approach. First, gene names are not standardized across species and the "same" gene (what that means is a whole different discussion) can have ...
terdon's user avatar
  • 10.2k
1 vote

How to properly annotate sequence variants and errors in a GenBank file format and how to keep track of successive versions of a GenBank file

Overview To properly address the questions, each possible case must be listed: Case 1: divergence between sequences (sequence in the file vs sequence of the molecule); two cases: a- (wrong) sequence ...
The Quark's user avatar
  • 131
1 vote

How to properly annotate sequence variants and errors in a GenBank file format and how to keep track of successive versions of a GenBank file

Your core question is: (mutations, insertion or deletions) that occurred during the molecular cloning process. I asked NCBI directly and their response is: For natural genetic variation use '...
M__'s user avatar
  • 12.6k
1 vote

Splitting a GenBank file into smaller files

I don't have time to give you a polished fully functional version but this will get you started. The next step will be a bit harder as you will need to capture the start of the first CDS in the chunk ...
Liam McIntyre's user avatar
1 vote

Splitting a GenBank file into smaller files

You can use NCBI EntrezDirect to download data in GenBank format for a specific region of the sequence as follows: ...
vkkodali's user avatar
  • 1,266
1 vote

How to programatically download SARS-CoV-2 fasta from NCBI/Genbank via API?

There are three ways to do this, If you click on this link Your NCBI examples. Its done. You would then just click "download" Click "next", click "next" The sequence ...
M__'s user avatar
  • 12.6k
1 vote

Parsing a GenBank file with multiple gene entries

You can do this very easily with awk: ...
terdon's user avatar
  • 10.2k
1 vote
Accepted

Parsing a GenBank file with multiple gene entries

You can simply use grep for this purpose as shown below, grep -v /translation bio.txt | grep -B100000000 /db_xref= > output_file.txt Just make sure that you ...
Ammar Sabir Cheema's user avatar
1 vote

Existing tool for converting gff3 to genbank (gbk)

Here's a python script based on the bcbio-gff (reading gff3) and biopython (writing genbank): https://github.com/chapmanb/bcbb/blob/master/gff/Scripts/gff/gff_to_genbank.py
mgalardini's user avatar
1 vote

Existing tool for converting gff3 to genbank (gbk)

You can use BioPerl to do this. Read in the GFF and make gene objects and write out those gene objects in Genbank format. Perhaps this tool (doing the opposite) will get you started: https://metacpan....
Dan Bolser's user avatar
1 vote

which NCBI tool is optimized to identify a species from a DNA fragment?

My conclusion from the tree is the fungi appears to be genuine and not an extant contaminant (which is very easily done). It is not Fomitopsis betulina because this is division Basidiomycota. The ...
M__'s user avatar
  • 12.6k

Only top scored, non community-wiki answers of a minimum length are eligible