Package: oceania-query-fasta
OcéanIA Query FastaOcéanIA Query Fasta lets you query large FASTA files available in theOcéanIA Platformfor extracting parts of biologic sequencesWhat is FASTA formatFASTA format is a text-based format for representing either nucleotide sequences or amino acid sequences, in which base pairs or amino acids are represented using single-letter codes. A sequence in FASTA format begins with a single-line description, followed by lines of sequence data. The description line is distinguished from the sequence data by a greater-than (">") symbol in the first column. An example sequence in FASTA format is:>TARA_X000000368_G_scaffold34_1_gene23 strand:- start:199 stop:642 length:444 start_codon:yes stop_codon:yes gene_type:complete
ATGAATACTCTTACTCGAATAAGCCTGACAATTTTTTTACTTTTGATGGCAGCTGTCTAT
TTACCAATTGGTTTATGGGCAATTATTGCTCCAGCTCAGGATGCCCTTGGTTTAGAACTA
CCTTCTTTTTATGAAGCTGTAGGCTTATCTGTAATATCTCCAATTGGGTATTCAGAATTT
GCAGGTATATATGGGGGCATTAATATTGTCATTGGCGTGATGTTCCTAATAGGCGTTTTT
AAAAAACAGGTCGGACTATTTGCTATAAAAGTTCTTGTATTTCTTGTTGGCTCAATAGCT
CTTGGAAGATTCTTGCTAATGTTGCTTGGATCCCAGGCAGGATTACCTGCAGAAATTAAT
GCTTTTCTTATCTTTGAAATAATTGTTTTCTTTATAGGTATTATTTTTATTAAAGTCCTA
AAAAACACTGATCATGTTACTTAGInstallation and usageInstallationOcéanIA Query Fasta can be installed by runningpip install oceania-query-fasta. It requires Python >= 3.6 to run.UsageThe library can be used as a command line tool or imported as a python library.As a python packagefromoceaniaimportget_sequences_from_fastaTARA_SAMPLE_ID="TARA_A100000171"# REQUEST_PARAMS is a list of tuples that identify subsequences to extract# each tuple must have the values (sequence_id, start_index, stop_index, sequence_type)# sequence type accepted values are [raw, complement, reverse_complement], optional value if ommited defaults to "raw".REQUEST_PARAMS=[("TARA_A100000171_G_scaffold48_1",10,50,"complement"),("TARA_A100000171_G_scaffold48_1",10,50),("TARA_A100000171_G_scaffold48_1",10,50,"reverse_complement"),("TARA_A100000171_G_scaffold181_1",0,50),("TARA_A100000171_G_scaffold181_1",100,200),("TARA_A100000171_G_scaffold181_1",200,230),("TARA_A100000171_G_scaffold493_2",54,76),("TARA_A100000171_G_scaffold50396_2",87,105),("TARA_A100000171_G_C2001995_1",20,635),("TARA_A100000171_G_C2026460_1",0,100),]request_result=get_sequences_from_fasta(TARA_SAMPLE_ID,REQUEST_PARAMS)# get_sequences_from_fasta returns a pandas.DataFrame with the extracted sequencesprint(request_result)Command lineIn the command line the query feature is available asoceania query-fasta <key> <query_file> <output_format> <output_file>>oceaniaquery-fasta-h
Usage:oceaniaquery-fasta[OPTIONS]<key><query_file><output_format><output_file>ExtractsecuencesfromafastafileintheOcéanIAPlatform.<sample_id>sampleidintheOcéanIAPlatform<query_file>CSVfilecontainingthevaluestoquery.Eachlinerepresentsasequencetoextractintheformat"sequence_id,start,end,type""sequence_id"sequenceID"start"startindexpositionofthesequencetobeextracted"end"endindexpositionofthesequencetoextract"type"typeofthesequencetoextractoptionsare["raw","complement","reverse_complement"]typevalueisoptional,ifnotprovideddefaultis"raw"<output_format>resultsformatoptionsare["csv","fasta"]<output_file>nameofthefiletowritetheresultsCode examplesFor more examples visitthis repository