def translate_image(self, image_name, x_units, y_units): input_image = cv2.imread(image_name, 1) file_name = "ReferenceImages/translation.jpg" translation = Translation() translated_image = translation.translate(input_image, y_units, x_units) cv2.imwrite(file_name, translated_image) rows, cols = translated_image.shape[0], translated_image.shape[1] return file_name, rows, cols
#filename="/home/bmajoros/1000G/assembly/BRCA1-NA19782.fasta"; filename="/Users/bmajoros/python/test/data/subset.fasta" print(FastaReader.getSize(filename)) [defline,seq]=FastaReader.firstSequence(filename) print(len(seq)) #filename="/home/bmajoros/1000G/assembly/test.fasta" filename="/Users/bmajoros/python/test/data/subset.fasta" hash=FastaReader.readAllAndKeepDefs(filename) for key in hash.keys(): [defline,seq]=hash[key] print(defline) [id,attrs]=FastaReader.parseDefline(defline) print("id="+id) for key,value in attrs.items(): print(key+"="+value) writer=FastaWriter() writer.writeFasta(">ABCD","ATCGATCGTAGCTAGTCTGCGCGTATCGTCAGTCTCTATCGATCGTACTGCGATCTAGCTAGCTGATCGTAGCTTCTATGACTGCTAGTCATCTAGCTAGCTGATCGTAGCTGCGCGCGATATATTGCATCTATGCTATCATTGCATGCTAGCTCTAGCTAGTCGATGCTATCTTAGCTAC","test1.fasta") writer.appendToFasta(">XYZ","GATTACA","test1.fasta") print(Translation.translate(seq)) print("forward:",seq) print("revcomp: ",Translation.reverseComplement(seq))