A small package to query data from the OceanIA services
Project description
OceanIA query
A small package to query data from the OceanIA services
Install
Install using pip
> pip install oceania-query-fasta
Usage
The library may be used directly as a command line tool or imported as a python package
Command line
In the command line:
> oceania query-fasta <key> <query_file> <output_format> <output_file>
For more information information:
> oceania query-fasta -h
Usage: oceania query-fasta [OPTIONS] <key> <query_file> <output_format> <output_file>
Extract secuences from a fasta file in the OceanIA Storage.
<key> object key in the OceanIA storage
<query_file> CSV file containing the values to query.
Each line represents a sequence to extract in the format "sequence_id,start,end,type"
"sequence_id" sequence ID
"start" start index position of the sequence to be extracted
"end" end index position of the sequence to extract
"type" type of the sequence to extract
options are ["raw", "complement", "reverse_complement"]
type value is optional, if not provided default is "raw"
<output_format> results format
options are ["csv", "fasta"]
<output_file> name of the file to write the results
Example
> oceania query-fasta data/raw/tara/OM-RGC_v2/assemblies/TARA_A100000171.scaftig.gz query.csv csv example.output.csv
query.csv:
TARA_A100000171_G_scaffold48_1,10,50,complement
TARA_A100000171_G_scaffold48_1,10,50,raw
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
As a python package
from oceania import OceaniaClient
# Create a client instance
oceania_client = OceaniaClient()
# Execute a query
oceania_client.get_sequences_from_fasta_to_file(key, positions, output_format, output_file)
Example
from oceania import OceaniaClient
oceania_client = OceaniaClient()
key = "data/raw/tara/OM-RGC_v2/assemblies/TARA_A100000171.scaftig.gz"
positions = [
["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],
]
oceania_client.get_sequences_from_fasta_to_file(
key,
positions,
"csv",
"test_output.csv"
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
oceania-query-fasta-0.1.6.tar.gz
(13.3 kB
view hashes)
Built Distribution
Close
Hashes for oceania-query-fasta-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f44ebcabf727a15402b35cb7388d8bb41642456bebaab3a75d3be8d08aa7485 |
|
MD5 | d0896977e6f5586dabc6033adca09149 |
|
BLAKE2b-256 | 8fad1ae08cb0f83eb2a5ce067a2460ebeb8c5c4066dd8ab975b5bca6075bc1bb |
Close
Hashes for oceania_query_fasta-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6866e137fb2d62496191a9507dd385c477ef8753c51ed5ebc309b125370fdb4 |
|
MD5 | be9d49545c29260325935da47be1a88b |
|
BLAKE2b-256 | 27e5fbd1e666f61d8dbc9e2beb3601960dc28bfda389badbdc0dbff031f25b10 |