Hot answers tagged

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 <...
  • 3,111
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: ...
  • 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 ...
  • 1,196
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 ...
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 ...
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 ...
3 votes

Genomics: Downloading genomic data from the NCBI Genbank database

For downloading data from commandline use the E-utilities of NCBI.
  • 273
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 ...
  • 2,574
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 ...
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&...
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 (...
  • 2,594
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 ...
  • 9,149
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 ? ...
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 ...
  • 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
  • 136
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: ...
  • 8,769
1 vote

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 ...
  • 739
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 '...
  • 9,149
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 ...
  • 9,149
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 ...
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: ...
  • 1,196
1 vote

Parsing a GenBank file with multiple gene entries

You can do this very easily with awk: ...
  • 8,769
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 ...
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....
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 ...
  • 9,149
1 vote
Accepted

Biopython Genbank writer not splitting long lines

I read the Biopython Genbank record source code carefully and realized I wasn’t using the Qualifier class correctly. After reading the source code again, I realized I was using the data structure ...
  • 21
1 vote

Parsing specific features from Genbank by label?

The /label=5'ITR is called a qualifier. You can look for those qualifiers: ...
  • 147
1 vote

Importing GFF file with Biopython

Most GFF parsers handle the work of reading annotation data into objects for convenient data access, but most do not handle the important task of resolving relationships between features. The tag ...
1 vote
Accepted

ANY (technical) reason behind submitting sequences to GenBank versus ENA Sequence

Opinion: I prefer to use EBI/ENA because the turnaround time for "customer service" on editing metadata about a submission is faster than on NCBI. Inquiries to change metadata on NCBI can go ...
  • 3,111
1 vote
Accepted

Source for whole genome comparisons at NCBI Genomes

I inquired into the details of the dendrograms after becoming frustrated with the lack of information. As with Ensembl, I'm sure that the folks at NCBI have a standardized pipeline that they run the ...
  • 1,129

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