#!/usr/bin/env python # coding: utf-8 # # Simple query to OcéanIA Platform TARA_R110002003 # ## This example shows how to extract arbitrary biological sub-sequences from a FASTA file available in the OcéanIA Platform # ### 1. Install oceania-query-fasta package # In[ ]: get_ipython().run_line_magic('pip', 'install oceania-query-fasta') # ### 2. Prepare request params # In[ ]: TARA_SAMPLE_ID = "TARA_R110002003" # 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_R110002003_G_scaffold3_1",3290,6293), ("TARA_R110002003_G_scaffold3_3",0,327), ("TARA_R110002003_G_scaffold3_3",944,2742), ("TARA_R110002003_G_scaffold3_4",379,379), ("TARA_R110002003_G_scaffold3_4",1530,1669) ] # ### 3. Perform call to the OcéanIA services # In[ ]: from oceania import get_sequences_from_fasta request_result = get_sequences_from_fasta( TARA_SAMPLE_ID, REQUEST_PARAMS ) # get_sequences_from_fasta returns a pandas.DataFrame with the extracted sequences print(request_result)