bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def _parse_organism(element): com_name=sci_name='' for organism_element in element.getchildren(): if organism_element.tag==NS + 'name': if organism_element.attrib['type']== 'scientific': if organism_element.text: sci_name=organism_element.text if (organism_element.attrib['type']== 'common') and not sci_name: if organis... | def _parse_organism(element): com_name=sci_name='' for organism_element in element.getchildren(): if organism_element.tag==NS + 'name': if organism_element.attrib['type']== 'scientific': sci_name=organism_element.text elif organism_element.attrib['type']== 'common': com_name=organism_element.text else: append_to_annota... | 448,200 |
def getAstralDomainsFromFile(self,filename=None,file_handle=None): """Get the scop domains from a file containing a list of sids""" if file_handle == filename == none: raise RuntimeError("You must provide a filename or handle") if not file_handle: file_handle = open(filename) doms = [] while 1: line = file_handle.readl... | def getAstralDomainsFromFile(self,filename=None,file_handle=None): """Get the scop domains from a file containing a list of sids""" if file_handle == filename == None: raise RuntimeError("You must provide a filename or handle") if not file_handle: file_handle = open(filename) doms = [] while 1: line = file_handle.readl... | 448,201 |
def init_chain(self, chain_id): """Initiate a new Chain object with given id. | def init_chain(self, chain_id): """Initiate a new Chain object with given id. | 448,202 |
def init_residue(self, resname, field, resseq, icode): """ Initiate a new Residue object. | def init_residue(self, resname, field, resseq, icode): """ Initiate a new Residue object. | 448,203 |
def init_atom(self, name, coord, b_factor, occupancy, altloc, fullname, serial_number=None, element=None): """ Initiate a new Atom object. | def init_atom(self, name, coord, b_factor, occupancy, altloc, fullname, serial_number=None, element=None): """ Initiate a new Atom object. | 448,204 |
def init_atom(self, name, coord, b_factor, occupancy, altloc, fullname, serial_number=None, element=None): """ Initiate a new Atom object. | def init_atom(self, name, coord, b_factor, occupancy, altloc, fullname, serial_number=None, element=None): """ Initiate a new Atom object. | 448,205 |
def get_coord(self): return self.coord | def get_coord(self): return self.coord | 448,206 |
def test_simple(self): """Test if Motif PWM scoring works.""" result = self.m.scanPWM(self.s) self.assertEqual(6, len(result)) # The fast C-code in Bio/Motif/_pwm.c stores all results as 32-bit # floats; the slower Python code in Bio/Motif/_Motif.py uses 64-bit # doubles. The C-code and Python code results will therefo... | def test_simple(self): """Test if Motif PWM scoring works.""" result = self.m.scanPWM(self.s) self.assertEqual(6, len(result)) # The fast C-code in Bio/Motif/_pwm.c stores all results as 32-bit # floats; the slower Python code in Bio/Motif/_Motif.py uses 64-bit # doubles. The C-code and Python code results will therefo... | 448,207 |
def write(sequences, handle, format): """Write complete set of sequences to a file. - sequences - A list (or iterator) of SeqRecord objects. - handle - File handle object to write to. - format - lower case string describing the file format to write. You should close the handle after calling this function. Retu... | def write(sequences, handle, format): """Write complete set of sequences to a file. - sequences - A list (or iterator) of SeqRecord objects. - handle - File handle object to write to. - format - lower case string describing the file format to write. You should close the handle after calling this function. Retu... | 448,208 |
def write(sequences, handle, format): """Write complete set of sequences to a file. - sequences - A list (or iterator) of SeqRecord objects. - handle - File handle object to write to. - format - lower case string describing the file format to write. You should close the handle after calling this function. Retu... | def write(sequences, handle, format): """Write complete set of sequences to a file. - sequences - A list (or iterator) of SeqRecord objects. - handle - File handle object to write to. - format - lower case string describing the file format to write. You should close the handle after calling this function. Retu... | 448,209 |
def parse(handle, format, alphabet=None): r"""Turns a sequence file into an iterator returning SeqRecords. - handle - handle to the file. - format - lower case string describing the file format. - alphabet - optional Alphabet object, useful when the sequence type cannot be automatically inferred from the file itse... | def parse(handle, format, alphabet=None): r"""Turns a sequence file into an iterator returning SeqRecords. - handle - handle to the file. - format - lower case string describing the file format. - alphabet - optional Alphabet object, useful when the sequence type cannot be automatically inferred from the file itse... | 448,210 |
def parse(handle, format, alphabet=None): r"""Turns a sequence file into an iterator returning SeqRecords. - handle - handle to the file. - format - lower case string describing the file format. - alphabet - optional Alphabet object, useful when the sequence type cannot be automatically inferred from the file itse... | def parse(handle, format, alphabet=None): r"""Turns a sequence file into an iterator returning SeqRecords. - handle - handle to the file. - format - lower case string describing the file format. - alphabet - optional Alphabet object, useful when the sequence type cannot be automatically inferred from the file itse... | 448,211 |
def _force_alphabet(record_iterator, alphabet): """Iterate over records, over-riding the alphabet (PRIVATE).""" #Assume the alphabet argument has been pre-validated given_base_class = _get_base_alphabet(alphabet).__class__ for record in record_iterator: if isinstance(_get_base_alphabet(record.seq.alphabet), given_base_... | def _force_alphabet(record_iterator, alphabet): """Iterate over records, over-riding the alphabet (PRIVATE).""" #Assume the alphabet argument has been pre-validated given_base_class = _get_base_alphabet(alphabet).__class__ for record in record_iterator: if isinstance(_get_base_alphabet(record.seq.alphabet), given_base_... | 448,212 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,213 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,214 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,215 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,216 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,217 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,218 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,219 |
def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | def to_alignment(sequences, alphabet=None, strict=True): """Returns a multiple sequence alignment (OBSOLETE). - sequences -An iterator that returns SeqRecord objects, or simply a list of SeqRecord objects. All the record sequences must be the same length. - alphabet - Optional alphabet. Stongly recommended. - strict... | 448,220 |
def convert(in_file, in_format, out_file, out_format, alphabet=None): """Convert between two sequence file formats, return number of records. - in_file - an input handle or filename - in_format - input file format, lower case string - out_file - an output handle or filename - out_format - output file format, lower cas... | def convert(in_file, in_format, out_file, out_format, alphabet=None): """Convert between two sequence file formats, return number of records. - in_file - an input handle or filename - in_format - input file format, lower case string - out_file - an output handle or filename - out_format - output file format, lower cas... | 448,221 |
def _test(): """Run the Bio.SeqIO module's doctests. This will try and locate the unit tests directory, and run the doctests from there in order that the relative paths used in the examples work. """ import doctest import os if os.path.isdir(os.path.join("..","..","Tests")): print "Runing doctests..." cur_dir = os.pat... | def _test(): """Run the Bio.SeqIO module's doctests. This will try and locate the unit tests directory, and run the doctests from there in order that the relative paths used in the examples work. """ import doctest import os if os.path.isdir(os.path.join("..", "..", "Tests")): print "Runing doctests..." cur_dir = os.p... | 448,222 |
def _test(): """Run the Bio.SeqIO module's doctests. This will try and locate the unit tests directory, and run the doctests from there in order that the relative paths used in the examples work. """ import doctest import os if os.path.isdir(os.path.join("..","..","Tests")): print "Runing doctests..." cur_dir = os.pat... | def _test(): """Run the Bio.SeqIO module's doctests. This will try and locate the unit tests directory, and run the doctests from there in order that the relative paths used in the examples work. """ import doctest import os if os.path.isdir(os.path.join("..","..","Tests")): print "Runing doctests..." cur_dir = os.pat... | 448,223 |
def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | 448,224 |
def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | 448,225 |
def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | 448,226 |
def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | 448,227 |
def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | def __init__(self, cmd="blastall",**kwargs): self.parameters = [ \ #Sorted in the same order as the output from blastall --help #which should make it easier to keep them up to date in future. #Note that some arguments are defined the the base clases (above). _Option(["-p", "program"], ["input"], None, 1, "The blast pro... | 448,228 |
def data(self) : """Sequence as a string (DEPRECATED). | def data(self) : """Sequence as a string (DEPRECATED). | 448,229 |
def __str__(self): """Returns the full sequence as a python string, use str(my_seq). | def__str__(self):"""Returnsthefullsequenceasapythonstring,usestr(my_seq). | 448,230 |
def _read_rx(reference, value): # The basic (older?) RX line is of the form: # RX MEDLINE; 85132727. # but there are variants of this that need to be dealt with (see below) # CLD1_HUMAN in Release 39 and DADR_DIDMA in Release 33 # have extraneous information in the RX line. Check for # this and chop it out of the l... | def _read_rx(reference, value): # The basic (older?) RX line is of the form: # RX MEDLINE; 85132727. # but there are variants of this that need to be dealt with (see below) # CLD1_HUMAN in Release 39 and DADR_DIDMA in Release 33 # have extraneous information in the RX line. Check for # this and chop it out of the l... | 448,231 |
def _read_rx(reference, value): # The basic (older?) RX line is of the form: # RX MEDLINE; 85132727. # but there are variants of this that need to be dealt with (see below) # CLD1_HUMAN in Release 39 and DADR_DIDMA in Release 33 # have extraneous information in the RX line. Check for # this and chop it out of the l... | def _read_rx(reference, value): # The basic (older?) RX line is of the form: # RX MEDLINE; 85132727. # but there are variants of this that need to be dealt with (see below) # CLD1_HUMAN in Release 39 and DADR_DIDMA in Release 33 # have extraneous information in the RX line. Check for # this and chop it out of the l... | 448,232 |
def test_blastn(self): """Pairwise BLASTN search""" global exe_names cline = Applications.NcbiblastpCommandline(exe_names["blastn"], query="GenBank/NC_005816.ffn", subject="GenBank/NC_005816.fna", evalue="0.000001") self.assertEqual(str(cline), exe_names["blastn"] \ + " -query GenBank/NC_005816.ffn -evalue 0.000001" \ ... | def test_blastn(self): """Pairwise BLASTN search""" global exe_names cline = Applications.NcbiblastnCommandline(exe_names["blastn"], query="GenBank/NC_005816.ffn", subject="GenBank/NC_005816.fna", evalue="0.000001") self.assertEqual(str(cline), exe_names["blastn"] \ + " -query GenBank/NC_005816.ffn -evalue 0.000001" \ ... | 448,233 |
def test_tblastn(self): """Pairwise TBLASTN search""" global exe_names cline = Applications.NcbiblastpCommandline(exe_names["tblastn"], query="GenBank/NC_005816.faa", subject="GenBank/NC_005816.fna", evalue="1e-6") self.assertEqual(str(cline), exe_names["tblastn"] \ + " -query GenBank/NC_005816.faa -evalue 1e-6" \ + " ... | def test_tblastn(self): """Pairwise TBLASTN search""" global exe_names cline = Applications.NcbitblastnCommandline(exe_names["tblastn"], query="GenBank/NC_005816.faa", subject="GenBank/NC_005816.fna", evalue="1e-6") self.assertEqual(str(cline), exe_names["tblastn"] \ + " -query GenBank/NC_005816.faa -evalue 1e-6" \ + "... | 448,234 |
def _parse_coordinates(self, coords_trailer): "Parse the atomic data in the PDB file." local_line_counter=0 structure_builder=self.structure_builder current_model_id=0 # Flag we have an open model model_open=0 current_chain_id=None current_segid=None current_residue_id=None current_resname=None for i in range(0, len(co... | def _parse_coordinates(self, coords_trailer): "Parse the atomic data in the PDB file." local_line_counter=0 structure_builder=self.structure_builder current_model_id=0 # Flag we have an open model model_open=0 current_chain_id=None current_segid=None current_residue_id=None current_resname=None for i in range(0, len(co... | 448,235 |
def _matrix(self,options): if not self.ntax or not self.nchar: raise NexusError('Dimensions must be specified before matrix!') self.matrix={} taxcount=0 first_matrix_block=True #eliminate empty lines and leading/trailing whitespace lines=[l.strip() for l in options.split('\n') if l.strip()!=''] lineiter=iter(lines) wh... | def _matrix(self,options): if not self.ntax or not self.nchar: raise NexusError('Dimensions must be specified before matrix!') self.matrix={} taxcount=0 first_matrix_block=True #eliminate empty lines and leading/trailing whitespace lines=[l.strip() for l in options.split('\n') if l.strip()!=''] lineiter=iter(lines) wh... | 448,236 |
def add_track(self, track, track_level): """ add_track(self, track, track_level) | def add_track(self, track, track_level): """ add_track(self, track, track_level) | 448,237 |
def _insdc_location_string_ignoring_strand_and_subfeatures(feature): if feature.ref: ref = "%s:" % feature.ref else: ref = "" assert not feature.ref_db if feature.location.start == feature.location.end \ and isinstance(feature.location.end, SeqFeature.ExactPosition): #Special case, 12^13 gets mapped to location 12:12 #... | def _insdc_location_string_ignoring_strand_and_subfeatures(feature): if feature.ref: ref = "%s:" % feature.ref else: ref = "" assert not feature.ref_db if feature.location.start == feature.location.end \ and isinstance(feature.location.end, SeqFeature.ExactPosition): #Special case, 12^13 gets mapped to location 12:12 #... | 448,238 |
def get_avg_fst_pair_locus(self, locus): if len(self.__fst_pair_locus) == 0 iter = self._controller.calc_fst_pair(self._fname)[0] for locus_info in iter: self.__fst_pair_locus[locus_info[0]] = locus_info[1] return self.__fst_pair_locus[locus] | def get_avg_fst_pair_locus(self, locus): if len(self.__fst_pair_locus) == 0: iter = self._controller.calc_fst_pair(self._fname)[0] for locus_info in iter: self.__fst_pair_locus[locus_info[0]] = locus_info[1] return self.__fst_pair_locus[locus] | 448,239 |
def mutate(self, organism): """Mutate the genome trying to put in 'helpful' mutations. """ new_org = organism.copy() gene_choices = new_org.genome.alphabet.letters | def mutate(self, organism): """Mutate the genome trying to put in 'helpful' mutations. """ new_org = organism.copy() gene_choices = new_org.genome.alphabet.letters | 448,240 |
def mutate(self, organism): """Mutate the genome trying to put in 'helpful' mutations. """ new_org = organism.copy() gene_choices = new_org.genome.alphabet.letters | def mutate(self, organism): """Mutate the genome trying to put in 'helpful' mutations. """ new_org = organism.copy() gene_choices = new_org.genome.alphabet.letters | 448,241 |
def mutate(self, organism): """Mutate the genome trying to put in 'helpful' mutations. """ new_org = organism.copy() gene_choices = new_org.genome.alphabet.letters | def mutate(self, organism): """Mutate the genome trying to put in 'helpful' mutations. """ new_org = organism.copy() gene_choices = new_org.genome.alphabet.letters | 448,242 |
def _test_read_factory(source, count): """Generate a test method for read()ing the given source. The generated function reads an example file to produce a phyloXML object, then tests for existence of the root node, and counts the number of phylogenies under the root. """ fname = os.path.basename(source) if zipfile.is_... | def _test_read_factory(source, count): """Generate a test method for read()ing the given source. The generated function reads an example file to produce a phyloXML object, then tests for existence of the root node, and counts the number of phylogenies under the root. """ fname = os.path.basename(source) def test_read(... | 448,243 |
def _test_parse_factory(source, count): """Generate a test method for parse()ing the given source. The generated function extracts each phylogenetic tree using the parse() function and counts the total number of trees extracted. """ fname = os.path.basename(source) if zipfile.is_zipfile(source): source = unzip(source)... | def _test_parse_factory(source, count): """Generate a test method for parse()ing the given source. The generated function extracts each phylogenetic tree using the parse() function and counts the total number of trees extracted. """ fname = os.path.basename(source) def test_parse(self): trees = PhyloXMLIO.parse(source... | 448,244 |
def _test_shape_factory(source, shapes): """Generate a test method for checking tree shapes. Counts the branches at each level of branching in a phylogenetic tree, 3 clades deep. """ fname = os.path.basename(source) if zipfile.is_zipfile(source): source = unzip(source) def test_shape(self): trees = PhyloXMLIO.parse(so... | def _test_shape_factory(source, shapes): """Generate a test method for checking tree shapes. Counts the branches at each level of branching in a phylogenetic tree, 3 clades deep. """ fname = os.path.basename(source) def test_shape(self): trees = PhyloXMLIO.parse(source) for tree, shape_expect in izip(trees, shapes): s... | 448,245 |
def test_shape(self): trees = PhyloXMLIO.parse(source) for tree, shape_expect in izip(trees, shapes): self.assertEquals(len(tree.clade), len(shape_expect)) for clade, sub_expect in izip(tree.clade, shape_expect): self.assertEquals(len(clade), sub_expect[0]) for subclade, len_expect in izip(clade, sub_expect[1]): self.a... | def test_shape(self): trees = PhyloXMLIO.parse(source) for tree, shape_expect in izip(trees, shapes): self.assertEquals(len(tree.clade), len(shape_expect)) for clade, sub_expect in izip(tree.clade, shape_expect): self.assertEquals(len(clade), sub_expect[0]) for subclade, len_expect in izip(clade, sub_expect[1]): self.a... | 448,246 |
def test_shape(self): trees = PhyloXMLIO.parse(source) for tree, shape_expect in izip(trees, shapes): self.assertEquals(len(tree.clade), len(shape_expect)) for clade, sub_expect in izip(tree.clade, shape_expect): self.assertEquals(len(clade), sub_expect[0]) for subclade, len_expect in izip(clade, sub_expect[1]): self.a... | def test_shape(self): trees = PhyloXMLIO.parse(source) for tree, shape_expect in izip(trees, shapes): self.assertEquals(len(tree.clade), len(shape_expect)) for clade, sub_expect in izip(tree.clade, shape_expect): self.assertEquals(len(clade), sub_expect[0]) for subclade, len_expect in izip(clade, sub_expect[1]): self.a... | 448,247 |
def test_shape(self): trees = PhyloXMLIO.parse(source) for tree, shape_expect in izip(trees, shapes): self.assertEquals(len(tree.clade), len(shape_expect)) for clade, sub_expect in izip(tree.clade, shape_expect): self.assertEquals(len(clade), sub_expect[0]) for subclade, len_expect in izip(clade, sub_expect[1]): self.a... | def test_shape(self): trees = PhyloXMLIO.parse(source) for tree, shape_expect in izip(trees, shapes): self.assertEquals(len(tree.clade), len(shape_expect)) for clade, sub_expect in izip(tree.clade, shape_expect): self.assertEquals(len(clade), sub_expect[0]) for subclade, len_expect in izip(clade, sub_expect[1]): self.a... | 448,248 |
def test_BinaryCharacters(self): """Instantiation of BinaryCharacters objects.""" tree = PhyloXMLIO.parse(EX_DOLLO).next() bchars = tree.clade[0,0].binary_characters self.assert_(isinstance(bchars, PX.BinaryCharacters)) self.assertEqual(bchars.type, 'parsimony inferred') for name, count, value in ( ('gained', 2, ['Cof... | def test_BinaryCharacters(self): """Instantiation of BinaryCharacters objects.""" tree = PhyloXMLIO.parse(EX_DOLLO).next() bchars = tree.clade[0,0].binary_characters self.assert_(isinstance(bchars, PX.BinaryCharacters)) self.assertEqual(bchars.type, 'parsimony inferred') for name, count, value in ( ('gained', 2, ['Cof... | 448,249 |
def test_Uri(self): """Instantiation of Uri objects.""" tree = list(PhyloXMLIO.parse(EX_PHYLO))[9] uri = tree.clade.taxonomies[0].uri self.assert_(isinstance(uri, PX.Uri)) self.assertEqual(uri.desc, 'EMBL REPTILE DATABASE') self.assertEqual(uri.value, 'http://www.embl-heidelberg.de/~uetz/families/Varanidae.html') | def test_Uri(self): """Instantiation of Uri objects.""" tree = list(PhyloXMLIO.parse(EX_PHYLO))[9] uri = tree.clade.taxonomies[0].uri self.assert_(isinstance(uri, PX.Uri)) self.assertEqual(uri.desc, 'EMBL REPTILE DATABASE') self.assertEqual(uri.value, 'http://www.embl-heidelberg.de/~uetz/families/Varanidae.html') | 448,250 |
def test_apaf(self): """Round-trip parsing and serialization of apaf.xml.""" self._stash_rewrite_and_call(EX_APAF, ( (ParseTests, [ 'test_read_apaf', 'test_parse_apaf', 'test_shape_apaf']), (TreeTests, ['test_DomainArchitecture']), )) | def test_apaf(self): """Round-trip parsing and serialization of apaf.xml.""" self._stash_rewrite_and_call(EX_APAF, ( (ParseTests, [ 'test_read_apaf', 'test_parse_apaf', 'test_shape_apaf']), (TreeTests, ['test_DomainArchitecture']), )) | 448,251 |
def test_bcl2(self): """Round-trip parsing and serialization of bcl_2.xml.""" self._stash_rewrite_and_call(EX_BCL2, ( (ParseTests, [ 'test_read_bcl2', 'test_parse_bcl2', 'test_shape_bcl2']), (TreeTests, ['test_Confidence']), )) | def test_bcl2(self): """Round-trip parsing and serialization of bcl_2.xml.""" self._stash_rewrite_and_call(EX_BCL2, ( (ParseTests, [ 'test_read_bcl2', 'test_parse_bcl2', 'test_shape_bcl2']), (TreeTests, ['test_Confidence']), )) | 448,252 |
def test_made(self): """Round-trip parsing and serialization of made_up.xml.""" self._stash_rewrite_and_call(EX_MADE, ( (ParseTests, ['test_read_made', 'test_parse_made']), (TreeTests, ['test_Confidence', 'test_Polygon']), )) | def test_made(self): """Round-trip parsing and serialization of made_up.xml.""" self._stash_rewrite_and_call(EX_MADE, ( (ParseTests, ['test_read_made', 'test_parse_made']), (TreeTests, ['test_Confidence', 'test_Polygon']), )) | 448,253 |
def test_phylo(self): """Round-trip parsing and serialization of phyloxml_examples.xml.""" self._stash_rewrite_and_call(EX_PHYLO, ( (ParseTests, [ 'test_read_phylo', 'test_parse_phylo', 'test_shape_phylo']), (TreeTests, [ 'test_Phyloxml', 'test_Other', 'test_Phylogeny', 'test_Clade', 'test_Annotation', 'test_CladeRe... | def test_phylo(self): """Round-trip parsing and serialization of phyloxml_examples.xml.""" self._stash_rewrite_and_call(EX_PHYLO, ( (ParseTests, [ 'test_read_phylo', 'test_parse_phylo', 'test_shape_phylo']), (TreeTests, [ 'test_Phyloxml', 'test_Other', 'test_Phylogeny', 'test_Clade', 'test_Annotation', 'test_CladeRe... | 448,254 |
def test_dollo(self): """Round-trip parsing and serialization of o_tol_332_d_dollo.xml.""" self._stash_rewrite_and_call(EX_DOLLO, ( (ParseTests, ['test_read_dollo', 'test_parse_dollo']), (TreeTests, ['test_BinaryCharacters']), )) | def test_dollo(self): """Round-trip parsing and serialization of o_tol_332_d_dollo.xml.""" self._stash_rewrite_and_call(EX_DOLLO, ( (ParseTests, ['test_read_dollo', 'test_parse_dollo']), (TreeTests, ['test_BinaryCharacters']), )) | 448,255 |
def confidence(self): """Equivalent to self.confidences[0] if there is only 1 value. | def confidence(self): """Equivalent to self.confidences[0] if there is only 1 value. | 448,256 |
def confidence(self): """Equivalent to self.confidences[0] if there is only 1 value. | def confidence(self): """Equivalent to self.confidences[0] if there is only 1 value. | 448,257 |
def __init__(self, # Attributes type=None, gained_count=None, lost_count=None, present_count=None, absent_count=None, # Child nodes (flattened into collections) gained=None, lost=None, present=None, absent=None): self.type=type self.gained_count=gained_count self.lost_count=lost_count self.present_count=present_count s... | def __init__(self, # Attributes type=None, gained_count=None, lost_count=None, present_count=None, absent_count=None, # Child nodes (flattened into collections) gained=None, lost=None, present=None, absent=None): self.type=type self.gained_count=gained_count self.lost_count=lost_count self.present_count=present_count s... | 448,258 |
def _shift(self, offset): """Returns a copy of the feature with its location shifted (PRIVATE). | def _shift(self, offset): """Returns a copy of the feature with its location shifted (PRIVATE). | 448,259 |
def test_Prank_simple_with_NEXUS_output(self): """Simple round-trip through app with infile, output in NEXUS output.?.??? files written to cwd - no way to redirect """ records = list(SeqIO.parse(open(self.infile1),"fasta")) #Try using keyword argument, cmdline = PrankCommandline(prank_exe, d=self.infile1, noxml=True) #... | def test_Prank_simple_with_NEXUS_output(self): """Simple round-trip through app with infile, output in NEXUS output.?.??? files written to cwd - no way to redirect """ records = list(SeqIO.parse(open(self.infile1),"fasta")) #Try using keyword argument, cmdline = PrankCommandline(prank_exe, d=self.infile1, noxml=True) #... | 448,260 |
def _open(cgi, params={}, post=False): """Helper function to build the URL and open a handle to it (PRIVATE). Open a handle to Entrez. cgi is the URL for the cgi script to access. params is a dictionary with the options to pass to it. Does some simple error checking, and will raise an IOError if it encounters one. ... | def _open(cgi, params={}, post=False): """Helper function to build the URL and open a handle to it (PRIVATE). Open a handle to Entrez. cgi is the URL for the cgi script to access. params is a dictionary with the options to pass to it. Does some simple error checking, and will raise an IOError if it encounters one. ... | 448,261 |
def _sff_file_header(handle): """Read in an SFF file header (PRIVATE). Assumes the handle is at the start of the file, will read forwards though the header and leave the handle pointing at the first record. Returns a tuple of values from the header (header_length, index_offset, index_length, number_of_reads, flows_per... | def _sff_file_header(handle): """Read in an SFF file header (PRIVATE). Assumes the handle is at the start of the file, will read forwards though the header and leave the handle pointing at the first record. Returns a tuple of values from the header (header_length, index_offset, index_length, number_of_reads, flows_per... | 448,262 |
def to_string(self,support_as_branchlengths=False,branchlengths_only=False,plain=True,plain_newick=False,ladderize=None): """Return a paup compatible tree line. to_string(self,support_as_branchlengths=False,branchlengths_only=False,plain=True) """ # if there's a conflict in the arguments, we override plain=True if sup... | def to_string(self,support_as_branchlengths=False,branchlengths_only=False,plain=True,plain_newick=False,ladderize=None,ignore_comments=True): """Return a paup compatible tree line. to_string(self,support_as_branchlengths=False,branchlengths_only=False,plain=True) """ # if there's a conflict in the arguments, we overr... | 448,263 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. info_string= '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches ha... | 448,264 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,265 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,266 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,267 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,268 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,269 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,270 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,271 |
def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | def make_info_string(data,terminal=False): """Creates nicely formatted support/branchlengths.""" # CHECK FORMATTING if self.plain: # plain tree only. That's easy. return '' elif self.support_as_branchlengths: # support as branchlengths (eg. PAUP), ignore actual branchlengths if terminal: # terminal branches have 100... | 448,272 |
def from_tree(self, tree, **kwargs): phy = Phylogeny( root=Clade.from_subtree(tree.root), rooted=tree.rooted, name=tree.name, id=Id(tree.id)) phy.__dict__.update(kwargs) return phy | def from_tree(self, tree, **kwargs): phy = Phylogeny( root=Clade.from_subtree(tree.root), rooted=tree.rooted, name=tree.name, id=(tree.id is not None) and Id(str(tree.id)) or None) phy.__dict__.update(kwargs) return phy | 448,273 |
def from_subtree(cls, subtree, **kwargs): """Create a new Clade from a BaseTree.Subtree object.""" clade = cls( branch_length=subtree.branch_length, name=subtree.name, node_id=Id(str(subtree.id))) clade.clades = [cls.from_subtree(st) for st in subtree.clades] clade.__dict__.update(kwargs) return clade | def from_subtree(cls, subtree, **kwargs): """Create a new Clade from a BaseTree.Subtree object.""" clade = cls(branch_length=subtree.branch_length, name=subtree.name) clade.clades = [cls.from_subtree(st) for st in subtree.clades] clade.__dict__.update(kwargs) return clade | 448,274 |
def to_phylogeny(self, **kwargs): """Create a new phylogeny containing just this clade.""" phy = Phylogeny(root=self, date=self.date) phy.__dict__.update(kwargs) return phy | def to_phylogeny(self, **kwargs): """Create a new phylogeny containing just this clade.""" phy = Phylogeny(root=self, date=self.date) phy.__dict__.update(kwargs) return phy | 448,275 |
def get_raw_check(self, filename, format, alphabet): if format in SeqIO._BinaryFormats: #This means SFF at the moment, which does not get #implement the get_raw method return handle = open(filename, "rU") raw_file = handle.read() handle.close() #Also checking the key_function here id_list = [rec.id.lower() for rec in \... | def get_raw_check(self, filename, format, alphabet): if format in SeqIO._BinaryFormats: #This means SFF at the moment, which does not get #implement the get_raw method return handle = open(filename, "rU") raw_file = handle.read() handle.close() #Also checking the key_function here id_list = [rec.id.lower() for rec in \... | 448,276 |
def _parse_pdb_header_list(header): # database fields dict={'name':"", 'head':'', 'deposition_date' : "1909-01-08", 'release_date' : "1909-01-08", 'structure_method' : "unknown", 'resolution' : 0.0, 'structure_reference' : "unknown", 'journal_reference' : "unknown", 'author' : "", 'compound':{'1':{'misc':''}},'source':... | def _parse_pdb_header_list(header): # database fields dict={'name':"", 'head':'', 'deposition_date' : "1909-01-08", 'release_date' : "1909-01-08", 'structure_method' : "unknown", 'resolution' : 0.0, 'structure_reference' : "unknown", 'journal_reference' : "unknown", 'author' : "", 'compound':{'1':{'misc':''}},'source':... | 448,277 |
def _parse_pdb_header_list(header): # database fields dict={'name':"", 'head':'', 'deposition_date' : "1909-01-08", 'release_date' : "1909-01-08", 'structure_method' : "unknown", 'resolution' : 0.0, 'structure_reference' : "unknown", 'journal_reference' : "unknown", 'author' : "", 'compound':{'1':{'misc':''}},'source':... | def _parse_pdb_header_list(header): # database fields dict={'name':"", 'head':'', 'deposition_date' : "1909-01-08", 'release_date' : "1909-01-08", 'structure_method' : "unknown", 'resolution' : 0.0, 'structure_reference' : "unknown", 'journal_reference' : "unknown", 'author' : "", 'compound':{'1':{'misc':''}},'source':... | 448,278 |
def _parse_pdb_header_list(header): # database fields dict={'name':"", 'head':'', 'deposition_date' : "1909-01-08", 'release_date' : "1909-01-08", 'structure_method' : "unknown", 'resolution' : 0.0, 'structure_reference' : "unknown", 'journal_reference' : "unknown", 'author' : "", 'compound':{'1':{'misc':''}},'source':... | def _parse_pdb_header_list(header): # database fields dict={'name':"", 'head':'', 'deposition_date' : "1909-01-08", 'release_date' : "1909-01-08", 'structure_method' : "unknown", 'resolution' : 0.0, 'structure_reference' : "unknown", 'journal_reference' : "unknown", 'author' : "", 'compound':{'1':{'misc':''}},'source':... | 448,279 |
def _get_location(self, range_info): """Return a (possibly fuzzy) location from a Range object. | def _get_location(self, range_info): """Return a (possibly fuzzy) location from a Range object. | 448,280 |
def _sff_read_raw_record(handle, number_of_flows_per_read): """Extract the next read in the file as a raw (bytes) string (PRIVATE).""" read_header_fmt = '>2HI' read_header_size = struct.calcsize(read_header_fmt) read_flow_fmt = ">%iH" % number_of_flows_per_read read_flow_size = struct.calcsize(read_flow_fmt) raw = han... | def _sff_read_raw_record(handle, number_of_flows_per_read): """Extract the next read in the file as a raw (bytes) string (PRIVATE).""" read_header_fmt = '>2HI' read_header_size = struct.calcsize(read_header_fmt) read_flow_fmt = ">%iH" % number_of_flows_per_read read_flow_size = struct.calcsize(read_flow_fmt) raw = han... | 448,281 |
def __eq__(cls, other): """RE == other -> bool | def __eq__(cls, other): """RE == other -> bool | 448,282 |
def __ne__(cls, other): """RE != other -> bool. isoschizomer strict, same recognition site, same restriction -> False all the other-> True""" if not isinstance(other, RestrictionType): return True elif cls.charac == other.charac: return False else: return True | def __ne__(cls, other): """RE != other -> bool. isoschizomer strict, same recognition site, same restriction -> False all the other-> True WARNING - This is not the inverse of the __eq__ method. """ if not isinstance(other, RestrictionType): return True elif cls.charac == other.charac: return False else: return True | 448,283 |
def do_not_cut(self, start, end, dct = None): """A.do_not_cut(start, end [, dct]) -> dict. | def do_not_cut(self, start, end, dct = None): """A.do_not_cut(start, end [, dct]) -> dict. | 448,284 |
def test_water_file(self): """water with the asis trick, output to a file.""" #Setup, try a mixture of keyword arguments and later additions: cline = WaterCommandline(cmd=exes["water"], gapopen="10", gapextend="0.5") #Try using both human readable names, and the literal ones: cline.set_parameter("asequence", "asis:ACCC... | def test_water_file(self): """water with the asis trick, output to a file.""" #Setup, try a mixture of keyword arguments and later additions: cline = WaterCommandline(cmd=exes["water"], gapopen="10", gapextend="0.5") #Try using both human readable names, and the literal ones: cline.set_parameter("asequence", "asis:ACCC... | 448,285 |
def test_needle_file(self): """needle with the asis trick, output to a file.""" #Setup, cline = NeedleCommandline(cmd=exes["needle"]) cline.set_parameter("-asequence", "asis:ACCCGGGCGCGGT") cline.set_parameter("-bsequence", "asis:ACCCGAGCGCGGT") cline.set_parameter("-gapopen", "10") cline.set_parameter("-gapextend", "0... | def test_needle_file(self): """needle with the asis trick, output to a file.""" #Setup, cline = NeedleCommandline(cmd=exes["needle"]) cline.set_parameter("-asequence", "asis:ACCCGGGCGCGGT") cline.set_parameter("-bsequence", "asis:ACCCGAGCGCGGT") cline.set_parameter("-gapopen", "10") cline.set_parameter("-gapextend", "0... | 448,286 |
def test_water_file2(self): """water with the asis trick and nucleotide FASTA file, output to a file.""" #Setup, query = "ACACACTCACACACACTTGGTCAGAGATGCTGTGCTTCTTGGAAGCAAGGNCTCAAAGGCAAGGTGCACGCAGAGGGACGTTTGAGTCTGGGATGAAGCATGTNCGTATTATTTATATGATGGAATTTCACGTTTTTATG" out_file = "Emboss/temp_test2.water" in_file = "Fasta/f0... | def test_water_file2(self): """water with the asis trick and nucleotide FASTA file, output to a file.""" #Setup, query = "ACACACTCACACACACTTGGTCAGAGATGCTGTGCTTCTTGGAAGCAAGGNCTCAAAGGCAAGGTGCACGCAGAGGGACGTTTGAGTCTGGGATGAAGCATGTNCGTATTATTTATATGATGGAATTTCACGTTTTTATG" out_file = "Emboss/temp_test2.water" in_file = "Fasta/f0... | 448,287 |
def test_water_file3(self): """water with the asis trick and GenBank file, output to a file.""" #Setup, query = "TGTTGTAATGTTTTAATGTTTCTTCTCCCTTTAGATGTACTACGTTTGGA" out_file = "Emboss/temp_test3.water" in_file = "GenBank/cor6_6.gb" self.assertTrue(os.path.isfile(in_file)) if os.path.isfile(out_file): os.remove(out_file... | def test_water_file3(self): """water with the asis trick and GenBank file, output to a file.""" #Setup, query = "TGTTGTAATGTTTTAATGTTTCTTCTCCCTTTAGATGTACTACGTTTGGA" out_file = "Emboss/temp_test3.water" in_file = "GenBank/cor6_6.gb" self.assertTrue(os.path.isfile(in_file)) if os.path.isfile(out_file): os.remove(out_file... | 448,288 |
def test_water_file4(self): """water with the asis trick and SwissProt file, output to a file.""" #Setup, query = "DVCTGKALCDPVTQNIKTYPVKIENLRVMI" out_file = "Emboss/temp_test4.water" in_file = "SwissProt/sp004" self.assertTrue(os.path.isfile(in_file)) if os.path.isfile(out_file): os.remove(out_file) cline = WaterComma... | def test_water_file4(self): """water with the asis trick and SwissProt file, output to a file.""" #Setup, query = "DVCTGKALCDPVTQNIKTYPVKIENLRVMI" out_file = "Emboss/temp_test4.water" in_file = "SwissProt/sp004" self.assertTrue(os.path.isfile(in_file)) if os.path.isfile(out_file): os.remove(out_file) cline = WaterComma... | 448,289 |
def __init__(self, cmd="primersearch", **kwargs): self.parameters = \ [_Option(["-sequences","sequences"], ["input"], None, 1, "Sequence to look for the primer pairs in."), _Option(["-primers","primers"], ["input", "file"], None, 1, "File containing the primer pairs to search for."), #Including -out and out for backwar... | def __init__(self, cmd="primersearch", **kwargs): self.parameters = \ [_Option(["-sequences","sequences"], ["input"], None, 1, "Sequence to look for the primer pairs in."), _Option(["-primers","primers"], ["input", "file"], None, 1, "File containing the primer pairs to search for."), #Including -out and out for backwar... | 448,290 |
def __init__(self, cmd="primersearch", **kwargs): self.parameters = \ [_Option(["-sequences","sequences"], ["input"], None, 1, "Sequence to look for the primer pairs in."), _Option(["-primers","primers"], ["input", "file"], None, 1, "File containing the primer pairs to search for."), #Including -out and out for backwar... | def __init__(self, cmd="primersearch", **kwargs): self.parameters = \ [_Option(["-sequences","sequences"], ["input"], None, 1, "Sequence to look for the primer pairs in."), _Option(["-primers","primers"], ["input", "file"], None, 1, "File containing the primer pairs to search for."), #Including -out and out for backwar... | 448,291 |
def _get_data_division(self, record): try: division = record.annotations["data_file_division"] except KeyError: division = "UNC" if division in ["PHG", "ENV", "FUN", "HUM", "INV", "MAM", "VRT", "MUS", "PLN", "PRO", "ROD", "SYN", "TGN", "UNC", "VRL"]: #Good, already EMBL style # Division Code # ---... | def _get_data_division(self, record): try: division = record.annotations["data_file_division"] except KeyError: division = "UNC" if division in ["PHG", "ENV", "FUN", "HUM", "INV", "MAM", "VRT", "MUS", "PLN", "PRO", "ROD", "SYN", "TGN", "UNC", "VRL", "XXX"]: #Good, already EMBL style # Division Code #... | 448,292 |
def FastqIlluminaIterator(handle, alphabet = single_letter_alphabet, title2ids = None): """Parse new Illumina 1.3+ FASTQ like files (which differ in the quality mapping). The optional arguments are the same as those for the FastqPhredIterator. For each sequence in Illumina 1.3+ FASTQ files there is a matching string ... | def FastqIlluminaIterator(handle, alphabet = single_letter_alphabet, title2ids = None): """Parse new Illumina 1.3+ FASTQ like files (which differ in the quality mapping). The optional arguments are the same as those for the FastqPhredIterator. For each sequence in Illumina 1.3+ FASTQ files there is a matching string ... | 448,293 |
def FastqIlluminaIterator(handle, alphabet = single_letter_alphabet, title2ids = None): """Parse new Illumina 1.3+ FASTQ like files (which differ in the quality mapping). The optional arguments are the same as those for the FastqPhredIterator. For each sequence in Illumina 1.3+ FASTQ files there is a matching string ... | def FastqIlluminaIterator(handle, alphabet = single_letter_alphabet, title2ids = None): """Parse new Illumina 1.3+ FASTQ like files (which differ in the quality mapping). The optional arguments are the same as those for the FastqPhredIterator. For each sequence in Illumina 1.3+ FASTQ files there is a matching string ... | 448,294 |
def externalEntityRefHandler(self, context, base, systemId, publicId): """The purpose of this function is to load the DTD locally, instead of downloading it from the URL specified in the XML. Using the local DTD results in much faster parsing. If the DTD is not found locally, we try to download it. If new DTDs become a... | def externalEntityRefHandler(self, context, base, systemId, publicId): """The purpose of this function is to load the DTD locally, instead of downloading it from the URL specified in the XML. Using the local DTD results in much faster parsing. If the DTD is not found locally, we try to download it. If new DTDs become a... | 448,295 |
def externalEntityRefHandler(self, context, base, systemId, publicId): """The purpose of this function is to load the DTD locally, instead of downloading it from the URL specified in the XML. Using the local DTD results in much faster parsing. If the DTD is not found locally, we try to download it. If new DTDs become a... | def externalEntityRefHandler(self, context, base, systemId, publicId): """The purpose of this function is to load the DTD locally, instead of downloading it from the URL specified in the XML. Using the local DTD results in much faster parsing. If the DTD is not found locally, we try to download it. If new DTDs become a... | 448,296 |
def _copy_and_check(matrix, desired_shape): # Copy the matrix. matrix = numpy.array(matrix, copy=1) # Check the dimensions. if matrix.shape != desired_shape: raise ValuError("Incorrect dimension") # Make sure it's normalized. if len(matrix.shape) == 1: if numpy.fabs(sum(matrix)-1.0) > 0.01: raise ValueError("matrix not... | def _copy_and_check(matrix, desired_shape): # Copy the matrix. matrix = numpy.array(matrix, copy=1) # Check the dimensions. if matrix.shape != desired_shape: raise ValueError("Incorrect dimension") # Make sure it's normalized. if len(matrix.shape) == 1: if numpy.fabs(sum(matrix)-1.0) > 0.01: raise ValueError("matrix no... | 448,297 |
def next(self): """Return the next record in the file""" line = self._lookahead if not line: return None assert line[0]==">", line lines = [line.rstrip()] line = self.handle.readline() while line: if line[0] == ">": break if line[0] == "#": if self._debug : print "Ignoring comment line" pass else: lines.append(line.rst... | def next(self): """Return the next record in the file""" line = self._lookahead if not line: return None assert line[0]==">", line lines = [line.rstrip()] line = self.handle.readline() while line: if line[0] == ">": break if line[0] == "#": if self._debug: print "Ignoring comment line" pass else: lines.append(line.rstr... | 448,298 |
def next(self): """Return the next record in the file""" line = self._lookahead if not line: return None assert line[0]==">", line lines = [line.rstrip()] line = self.handle.readline() while line: if line[0] == ">": break if line[0] == "#": if self._debug : print "Ignoring comment line" pass else: lines.append(line.rst... | def next(self): """Return the next record in the file""" line = self._lookahead if not line: return None assert line[0]==">", line lines = [line.rstrip()] line = self.handle.readline() while line: if line[0] == ">": break if line[0] == "#": if self._debug : print "Ignoring comment line" pass else: lines.append(line.rst... | 448,299 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.