biopython

AttributeError: 'list' object has no attribute 'SeqRecord' - while trying to slice multiple sequences with Biopython>SeqIO from fasta file

不羁岁月 提交于 2021-02-11 17:52:31
问题 I am trying to generate varying length N and C termini Slices (1,2,3,4,5,6,7). But before I get there I am having problems just reading in my fasta files. I was following the 'Random subsequences' head tutorial from:https://biopython.org/wiki/SeqIO . But in this case there is only one sequence so maybe that is where I went wrong. The code with example sequences and my errors. Any help would be much appreciated. I am clearly out of my depth. It looks like there are a lot of similar problems

AttributeError: 'list' object has no attribute 'SeqRecord' - while trying to slice multiple sequences with Biopython>SeqIO from fasta file

女生的网名这么多〃 提交于 2021-02-11 17:51:04
问题 I am trying to generate varying length N and C termini Slices (1,2,3,4,5,6,7). But before I get there I am having problems just reading in my fasta files. I was following the 'Random subsequences' head tutorial from:https://biopython.org/wiki/SeqIO . But in this case there is only one sequence so maybe that is where I went wrong. The code with example sequences and my errors. Any help would be much appreciated. I am clearly out of my depth. It looks like there are a lot of similar problems

BioPython AlignIO ValueError says strings must be same length?

安稳与你 提交于 2021-02-10 11:30:46
问题 Input fasta-format text file: http://www.jcvi.org/cgi-bin/tigrfams/DownloadFile.cgi?file=/opt/www/www_tmp/tigrfams/fa_alignment_PF00205.txt #!/usr/bin/python from Bio import AlignIO seq_file = open('/path/to/fa_alignment_PF00205.txt') alignment = AlignIO.read(seq_file, "fasta") Error: ValueError: Sequences must all be the same length The input sequences shouldn't have to be the same length since on ClustalOmega you can align sequences of differing lengths. This also doesn't work...gets the

BioPython AlignIO ValueError says strings must be same length?

北城余情 提交于 2021-02-10 11:28:17
问题 Input fasta-format text file: http://www.jcvi.org/cgi-bin/tigrfams/DownloadFile.cgi?file=/opt/www/www_tmp/tigrfams/fa_alignment_PF00205.txt #!/usr/bin/python from Bio import AlignIO seq_file = open('/path/to/fa_alignment_PF00205.txt') alignment = AlignIO.read(seq_file, "fasta") Error: ValueError: Sequences must all be the same length The input sequences shouldn't have to be the same length since on ClustalOmega you can align sequences of differing lengths. This also doesn't work...gets the

Extracting only the chains that we need from a PDB file

落爺英雄遲暮 提交于 2021-01-28 07:04:15
问题 I need to extract specific chains from PDB files( Sometiems more than one chain). How to extract chains from a PDB file?. It's the same question and "marked" answer, answers my problem. But it does not work in python 3. It gives errors one after the other. Does anybody knows how can i work this in python 3? Or any other code for the same kind of problem Thank you in advance. import os from Bio import PDB class ChainSplitter: def __init__(self, out_dir=None): """ Create parsing and writing

Changing the default python version on Mac - Installing Biopython

不羁岁月 提交于 2021-01-05 08:51:55
问题 My Mac came installed with python 2.7 as the default python version. But, this version is no longer supported by many packages and software. I searched several online forums regarding how to change the default python version on mac. But, none of them seem to work. I also installed the latest version of python, and if I type: python --version It returns the version as python 3.8. But if I try to install packages like Biopython, I get an error like this - defaulting to user installation because

Error while writing fasta file using biopython

梦想的初衷 提交于 2020-12-11 22:02:07
问题 I used the following code to write the fasta sequence into file. from Bio import SeqIO sequences = "KKPPLLRR" # add code here output_handle = open("example.fasta", "w") SeqIO.write(sequences, output_handle, "fasta") output_handle.close() I got the following error: self = <Bio.SeqIO.FastaIO.FastaWriter object at 0x21c1d10>, record = 'M' def write_record(self, record): """Write a single Fasta record to the file.""" assert self._header_written assert not self._footer_written self._record_written

Error while writing fasta file using biopython

不问归期 提交于 2020-12-11 21:59:12
问题 I used the following code to write the fasta sequence into file. from Bio import SeqIO sequences = "KKPPLLRR" # add code here output_handle = open("example.fasta", "w") SeqIO.write(sequences, output_handle, "fasta") output_handle.close() I got the following error: self = <Bio.SeqIO.FastaIO.FastaWriter object at 0x21c1d10>, record = 'M' def write_record(self, record): """Write a single Fasta record to the file.""" assert self._header_written assert not self._footer_written self._record_written

Error while writing fasta file using biopython

独自空忆成欢 提交于 2020-12-11 21:59:05
问题 I used the following code to write the fasta sequence into file. from Bio import SeqIO sequences = "KKPPLLRR" # add code here output_handle = open("example.fasta", "w") SeqIO.write(sequences, output_handle, "fasta") output_handle.close() I got the following error: self = <Bio.SeqIO.FastaIO.FastaWriter object at 0x21c1d10>, record = 'M' def write_record(self, record): """Write a single Fasta record to the file.""" assert self._header_written assert not self._footer_written self._record_written

python: can i move a file based on part of the name to a folder with that name

吃可爱长大的小学妹 提交于 2020-12-04 03:19:51
问题 I have a directory with a large number of files that I want to move into folders based on part of the file name. My list of files looks like this: ID1_geneabc_species1.fa ID1_genexy_species1.fa ID2_geneabc_species1.fa ID3_geneabc_species2.fa ID3_genexy_species2.fa ID4_genexy_species3.fa I want to move the files I have into separate folders based on the last part of the file name (species1, species2, species3). The first parts of the file name do not always have the same number of numbers and