New answers tagged

0

Answer from @matteo-ferla, converted from comment: If command line interface is more suitable for you, you may consider OpenBabel, which can predict Gasteiger charges, protonate at pH 7, accept a smi file of multiple SMILES or a multi-entry sdf file and can output in PDQBT format, but is not quite the same as the python script allows merging and various ...


2

Since this is not a correct PDB file, it can be interpreted differently by different PDB reading libraries. The most reliable way to change it would be to read it as plain text and change the chain ID to B in the lines that have segment ID LA0. Note: Strings RA0 and LA0 start at column 73. Columns in the PDB format correspond to characters. This is not a ...


4

I am pretty sure there would be more elegant, in-place solutions but here is a quick solution to your problem. Should be OK if your sequence dictionary is not way too large. seq_names = zip(data['old_name'], data['new_name']) # brings together old and new names in tuples renamed_sequence = {} for i in seq_names: renamed_sequence[i[1]] = sequence[i[0]] ...


1

I am assuming you only want keys where both tuple items are present. If so, this should work: no_match = [] for item in list1: item1, item2 = item wanted_keys = [ key for key in dict1.keys() if item1 in dict1[key] and item2 in dict1[key] ] if len(wanted_keys) > 0: print("%s: %s" % (item, ...


0

I see 2 problems. First, you need to check if the qualifier your are searching for exists in the given CDS feature. Second, the qualifier holds more then just the string PKS for example Domain: PKS_AT (537-846). E-value: 1.5e-98. You could modify your code like this: feature_type = "CDS" feature_qualifier = "NRPS_PKS" target = "PKS&...


0

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 : from Bio.PDB import Chain, Atom, NeighborSearch, PDBParser, Selection def get_hydrogen_atoms(c_alpha_atom: Atom.Atom, po): ns = NeighborSearch(po) return [h for h in ...


1

You're missing a comma between the two output lines. (John Marshall's more detailed syntax error message was spot-on.) With a simplified version of your Snakefile: SAMPLES=["s1", "s2", "s3"] rule run_fastqc: output: expand("{sample}_{{Rnumber}}_001.fastqc.html", sample=SAMPLES) expand("{sample}...


2

How to figure out what error messages are trying to tell you is one of the great mysteries… :-) What version of Snakemake are you using? I get slightly different messages. With an ancient version (3.13.3) on one machine: SyntaxError in line 14 of /path/to/Snakefile: invalid syntax With a more up-to-date version (6.9.1, running on Python 3.9): SyntaxError in ...


1

From a quick look at the manual, it looks like you are supposed to use just the wrapper, not combine the wrapper with a shell. Can you show me an example of such combined usage? The error seems to suggest that the wrapper already has a shell directive that you shell conflicts with.


1

You need to iterate over the sequence 3 characters at a time and you need to stop when you hit the stop codon (or before for an invalid codon, e.g. of length 2). Here is a memory efficient implementation using iterators (requires python >= 3.8): from itertools import islice def protfromRNA(Seq): it = iter(Seq) lst = [] while codon := "&...


0

Not Python, but you can do this with BioStructures.jl in Julia: using BioStructures pdblist = pdbentrylist() for pdbid in pdblist # Download a file and delete it after use downloadpdb(pdbid, format=MMCIF) do fp s = read(fp, MMCIF) # Do something with the file, e.g. print the cysteine fraction nres = countresidues(s, ...


3

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 {GenBank(Full)} here my code: from Bio import SeqIO from Bio.Seq import Seq from Bio.SeqRecord import SeqRecord file_name = 'CMCP6.gb' # stores all the CDS entries ...


Top 50 recent answers are included