Skip to main content
6 votes
Accepted

Can I traverse/enumerate PDB one at a time using a Python script without downloading all of them to my local disk?

The page https://www.wwpdb.org/ftp/pdb-ftp-sites gives the addresses of interest. PDB has an FTP site downloadable via rsync and the latter has a dry run mode. ...
Matteo Ferla's user avatar
  • 4,244
5 votes
Accepted

Read PDB file, extract dihedral angles, modify dihedral angles, reconstruct Cartesian coordinates, and write PDB file

ok, here my input pdb, example_short.pdb : ...
pippo1980's user avatar
  • 1,108
5 votes
Accepted

How does BioPython generate IDs for atoms, residues, chains, and structures?

When reading PDB file ("1fat.pdb" as an example): ...
Bioinfotec's user avatar
4 votes

Read PDB file, extract dihedral angles, modify dihedral angles, reconstruct Cartesian coordinates, and write PDB file

I answered about doing it with PyRosetta as I assumed that as BioPython PDB module is basic and the fact it was being asked made me think it was not possible. Turns out I was wrong. So I am making a ...
Matteo Ferla's user avatar
  • 4,244
4 votes

Read PDB file, extract dihedral angles, modify dihedral angles, reconstruct Cartesian coordinates, and write PDB file

I do not know if there is a function in Biopython.PDB for dihedral space transformations, but due to the lack of answers I would say no. Biopython.PDB is nice and clean, but I would use something with ...
Matteo Ferla's user avatar
  • 4,244
4 votes

File I/O error using nglview.show_biopython(structure)

I also figured out another way to fix this problem. After going back to the tutorial I was talking about I saw that it was made back in 2021. After seeing this I wonder if we were using the same ...
Jeremiah Wade's user avatar
4 votes

open and read Fasta file (raw data)

It sounds like all you really want is to print every 2nd line of a text file. If so, you don't need Python, let alone BioPython, you can do it with basic *nix tools: ...
terdon's user avatar
  • 10.2k
3 votes

File I/O error using nglview.show_biopython(structure)

This is an issue with Biopython 1.80, in particular introduced by a commit that automatically closes IO objects sent to PDBIO.save. I made a PR to change the ...
jgreener's user avatar
  • 941
3 votes
Accepted

Getting ALL Protein entries from Entrez for a particular taxonomic id

As suggested by somebody, the datasets tools from NCBI is blazing fast: datasets download genome taxon 187492 --include protein NCBI Datasets Tool
The August's user avatar
3 votes

File I/O error using nglview.show_biopython(structure)

I had a similar problem with: ...
pippo1980's user avatar
  • 1,108
3 votes

How to write FASTA records using "Bio.SeqIO.write()"

I figured it out: ...
Supertech's user avatar
  • 606
3 votes
Accepted

KeyError '/n' in Bio SeqUtils Package ProtParam Script

When the user is pushing enter on their keyboard, it is likely inserting a newline character (\n) at the end of the user input <...
JamesT's user avatar
  • 191
3 votes
Accepted

Residue numbering in biopython

@M__ is right - there's a molecule_type error when you try to write and this needs to be fixed. Here's my end to end approach: The input file: ...
Ram RS's user avatar
  • 2,425
3 votes
Accepted

How to extract the protein sequences of a genbank file using R or biopython

ok tried a little bit, not sure is the most elegant/fastest way of doing it starting from file from : https://www.ncbi.nlm.nih.gov/nuccore/NC_004460.2?report=gbwithparts&log$=seqview {...
pippo1980's user avatar
  • 1,108
2 votes
Accepted

Help using BioPython's IC_Chain functionality for getting protein 3D coordinates from torsion angles

It turns out that in order to generate the internal coordinates for a protein structure, one shouldn't manually create an IC_Chain object, but rather just use the <...
CubeHead's user avatar
  • 425
2 votes

Help using BioPython's IC_Chain functionality for getting protein 3D coordinates from torsion angles

not able to grasp the question, tried to figure out a way to show the internal_coordinates: ...
pippo1980's user avatar
  • 1,108
2 votes
Accepted

How can I get a list of neighboring Hydrogen atoms of an alpha-carbon?

You posted similar question here: https://stackoverflow.com/questions/69676943/how-can-i-get-a-list-of-neighboring-hydrogen-atoms-of-an-alpha-carbon/69815509#69815509 ok got some code : ...
pippo1980's user avatar
  • 1,108
2 votes

Remove Redundant Sequences from FASTA file with Biopython reducing memory footprint

I wrote the answer here and while I'm not clear on all aspects of this question, I can offer two suggestions to reduce the memory footprint considerably while maintaining high speed. First, rather ...
Chris_Rands's user avatar
  • 3,948
2 votes

How to calculate the variant allelic fraction (VAF) from VEP output?

If you just have a VEP output (i.e. VCF) without raw genotypes then you cannot calculate the allelic fraction.
user438383's user avatar
  • 1,689
2 votes

How can I make this Biopython program (to correct erroneous barcodes) run faster, and is there any alternative method?

Try profiling (benchmarking) your code to work out where it is slow. My other suggestions are: replace your simple Pure Python hamming_distance function with something optimised like RapidFuzz - see ...
Peter Cock's user avatar
2 votes

How to write FASTA records using "Bio.SeqIO.write()"

my attempt at changing the way Biopython formats fasta file sequence width, read into code to figure out standard behaviour: ...
pippo1980's user avatar
  • 1,108
2 votes

How to write FASTA records using "Bio.SeqIO.write()"

You could instead pass in a generator that yields SeqRecords. This avoids storing the entire list of sequences in memory and is usually the way to go assuming that you need to handle large files ...
Steve's user avatar
  • 3,109
2 votes

How to parse hmmsearch output?

The TSV output should be sorted by default in a way that for a given query the top hit comes first, followed by other hits. For a quick extraction of top hits you may use a rather simplistic script: ...
darked89's user avatar
  • 368
2 votes
Accepted

BioPython bootstrap is not reliable?

I think this is a bug. It seems to work if you do this, creating an equivalent Alignment object instead of a MultipleSeqAlignment to give the bootstrap step: ...
Jesse's user avatar
  • 947
2 votes
Accepted

Blastn through NCBIWWW not giving any results, as opposed to the online BLAST

This is easy. If you set expect=1000, to expect=100, It will work. NCBI servers impose a tighter restriction on the CLI whilst ...
M__'s user avatar
  • 12.6k
2 votes
Accepted

Biopython / ETE3 get subtree of a newick tree

If we are talking pointers only then the pseudo code I use the ETE3 method ...
M__'s user avatar
  • 12.6k
2 votes

Biopython / ETE3 get subtree of a newick tree

Actually ended up doing this to get the neighborhood of a node ...
El Dude's user avatar
  • 195
1 vote

How does BioPython generate IDs for atoms, residues, chains, and structures?

PDB data-files contain identifiers for all those objects. Although I'm not familiar with BioPython's PDB support, I'd expect it to be reading the IDs from the file. The use of those IDs by the PDB can ...
Dan Bolser's user avatar
1 vote

All against all sequence alignment

I wouldn't use Python here. I've looked at using Bio.pairwise2.align. and its has major shortcomings. In this context the problem is establishing homologous ...
M__'s user avatar
  • 12.6k
1 vote

How to parse hmmsearch output?

Since we don't know what you are trying to maximize here, which of the various columns would define the "best" hit for what you are trying to do, here is a generic solution that will just ...
terdon's user avatar
  • 10.2k

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