18
votes
Accepted
How can I do an overlapping sequence count in Biopython?
For Biopython 1.70, there is a new Seq.count_overlap() method, which includes optional start and ...
18
votes
Accepted
How do you write a .gz fastq file with Biopython?
I'm not sure I'm doing it the best way, but here is an example where I read a compressed gzip fastq file and write the records in block gzip fastq:
...
10
votes
Accepted
Changing the record id in a FASTA file using BioPython
If I use SeqIO.parse(filehandle, 'fasta') to parse a FASTA file, then it will return a SeqRecord object where the ...
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 <...
9
votes
How can I do an overlapping sequence count in Biopython?
I've encountered this problem before, and used python re module to solve this problem.
...
8
votes
Accepted
Read and write FASTA files with more information than id and sequence
The description field in the SeqRecord object has the information you are looking for:
...
8
votes
Accepted
How do I find identical sequences in a FASTA file?
The trick would be to swap the key in the dictionary to be the sequence itself.
Also I would recommend using a different separator that "_" since that is what the current ids have so that you can ...
8
votes
Accepted
Biopython Phylogenetic Tree replace branch tip labels by sequence logos
To expand on my comment from yesterday. You could do this with the ETE Toolkit (I just copied one logo file rather than converting all 26 to png):
...
7
votes
Accepted
Subset FASTA file by species name
Splitting into multiple files and changing the IDs can be easily done:
...
7
votes
How to create Phylogenetic Trees from fasta files in Python or R?
I would not look for a package for this, but instead build a small pipeline calling external tools with something like the following workflow:
Cluster the ~100 sequences with CD-HIT-EST/PSI-CD-HIT or ...
6
votes
Accepted
Is there any way of using biopython to write Swissprot files?
Using SeqIO.index rather than SeqIO.parse lets you read all the records into a dict, from ...
6
votes
Why do BLASTn and prokka not seem to be searching the whole fasta file?
With a k-mer size of 28 it shouldn't be finding that many matches. And the prokka results are suspicious as well. Maybe you have multiple contigs (none larger than 100kb) in that file? What is the ...
6
votes
Accepted
How can I reproduce a manual NCBI search with Biopython Entrez module?
This can be done by using the "Search details" as a search term in Entrez.esearch:
...
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:
...
6
votes
Accepted
Possibility to save output blastn table in memory using biopython
You can specify send to stdout using out='-' in the Biopython wrapper.
...
6
votes
How to make 3d model of a protein that not exist in PDB?
No PDB
Getting a crystal structure is hard work for crystallographers, even with a high throughput systems, so they make constructs with only known domains or regions of particular interest. What ...
6
votes
Accepted
BioPython internal_coords module returns different dihedral angles for the (seemingly) same protein structure
The problem got solved after posting on the official BioPython repo.
Because of the processing (where some residues were removed in order to align the proteins), some consecutive residues were too far ...
5
votes
For what bioinformatics tasks is Biopython more adapted than Bioperl?
Regading the perl vs python discussion, there is no final answer which language is better, but I have some advice for you:
Learn the language your colleagues or your advisor use. This way you are ...
5
votes
For what bioinformatics tasks is Biopython more adapted than Bioperl?
Currently you could use either but a major question is which platform will others be using in the future. AFAIK Perl is only superior to Python for regex.
Based on the trend I see for new programmers ...
5
votes
Accepted
After artificially creating events in a FASTA file, how do I keep track of the old coordinates?
I've written a handful of programs from scratch to simulate mutations and variations in real or simulated sequences.
The trick has always been to sort the variants by genomic coordinate, apply the ...
5
votes
How do you generate read-length vs read-quality plot for long-read sequencing data (e.g., MinION)?
I also wrote a package to create various plots from Oxford Nanopore sequencing data and alignments: NanoPlot. It can be installed through pip (see also the README on Github). In addition to multiple ...
5
votes
Accepted
How can I edit a specific FASTQ read in place, given the read ID?
You'll first need to determine the appropriate line number, which you can do with grep -m1 -nw "@31027" foo.fastq. After that, note that you can provide a line ...
5
votes
Accepted
Why doesn't Biopython AlignIO.read() recognise the 'mauve' format?
You're using version 1.68 or older. Mauve support was added in 1.70.
5
votes
Accepted
5
votes
How to translate amino acid sequences to Nucleotide sequences
Although there is not a unique nucleotide sequence that translates to a given protein, one can list all the possible DNA sequences that do translate to that protein.
An online tool that does just ...
5
votes
Accepted
Remove Redundant Sequences from FASTA file in Python
Your code (as currently formatted) should generate the correct output, but it is not efficient. Make seen a set to improve these O(n) ...
4
votes
Getting protein FASTA sequence based on keyword with python
Found what I was looking for. In:
searchResultHandle = Entrez.esearch(db="protein", term="terminase large", retmax=1000)
I've added:
...
4
votes
How can I do an overlapping sequence count in Biopython?
You can use finditer from python's re module. The advantage of this approach is it allows for getting the indices of those ...
4
votes
How do you generate read-length vs read-quality plot for long-read sequencing data (e.g., MinION)?
It's important to always consider read length and quality jointly with high-error read data, and current long-read technologies (e.g., MinION and PacBio) have high error rates. Considering read length ...
4
votes
After artificially creating events in a FASTA file, how do I keep track of the old coordinates?
If you look for a program which would randomly introduce SNPs + short indels and then would save everything into a VCF file, DWGsim or Mason Variator could be a good choice. Then you can create a ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
biopython × 169python × 81
fasta × 26
proteins × 18
phylogenetics × 16
pdb × 14
protein-structure × 12
phylogeny × 11
genbank × 8
sequence-alignment × 7
annotation × 7
blast × 7
seqio × 7
alignment × 6
ncbi × 6
covid-19 × 6
bioconductor × 5
public-databases × 5
r × 4
sequencing × 4
database × 4
sequence-analysis × 4
dna × 4
fastq × 4
homework × 4