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,234
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,043
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,234
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,234
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
  • 9,881
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
  • 931
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,043
3 votes

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

I figured it out: ...
Supertech's user avatar
  • 596
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,299
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,043
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
  • 415
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,043
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,043
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,679
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,043
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,079
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
  • 293
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.1k
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
  • 9,881
1 vote

retrieving past BLAST requests in bioPython

1 and 2 —> Yes, but you need to have the query ID in order to do so: having the description would be a bonus, but not required. If you go to 8.1.1 Query Result of the Biopython manual, it will ...
Rachel Sweeney's user avatar
1 vote
Accepted

BioPython SeqIO fails with Invalid Alphabet found

Quickly ... from Bio.Alphabet import generic_protein from Bio.Seq import Seq then .. ...
M__'s user avatar
  • 12.1k
1 vote
Accepted

Download all pubmed central article ids that have a keyword appearing in their titles/abstracts and also falling between two dates

There seems to be a problem with using the [Title/Abstract] field. What you have looks correct and should produce the expected result, since it should capture ...
Steve's user avatar
  • 3,079
1 vote

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

tried to understand git, I ended up with this, seems more coherent with the previous habits in the biopython project, but cant push it. Anyone could pass it along ? [of course needs to be checked out,...
pippo1980's user avatar
  • 1,043

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