Пример #1
0
    def upload_missing_contigs(self, genomes=None):
        """
        Compiles a list of genomes with missing and unvalidated sequences
        and uploads them to Blazegraph.
        """

        list_of_genomes = []

        if not genomes:
            list_of_genomes = find_missing_sequences()
        else:
            list_of_genomes = genomes

        # find missing_sequences() returns a list of two-tuples (genome, accession number)
        for (genome, accession) in list_of_genomes:
            contigswrapper = ContigsWrapper(genome, accession)
            try:
                self.get_seqdata(contigswrapper)
                if contigswrapper.dict["is_from"] == "PLASMID":
                    self.upload(contigswrapper, self.plasmid_rdf)
                else:
                    SequenceValidator(contigswrapper).validate()
                    self.upload(contigswrapper, self.nonplasmid_rdf)
                gc.collect()
            except TypeError:
                self.error_logging(contigswrapper)
Пример #2
0
 def upload_missing_sequences(self):
     """Compiles a list of genomes with missing and unvalidated sequences
     and uploads them to Blazegraph.
     """
     for (genome, accession) in find_missing_sequences():
         seqdata = SequenceMetadata(genome, accession)
         try:
             self.load_sequence(seqdata)
             if seqdata.dict["is_from"] == "PLASMID":
                 self.upload(seqdata, self.plasmid_rdf)
             else:
                 SequenceValidator(seqdata).validate()
                 self.upload(seqdata, self.nonplasmid_rdf)
             gc.collect()
         except TypeError:
             self.error_logging(seqdata)