phiweger / zoo

A portable datastructure for rapid prototyping in (viral) bioinformatics (under development).
5 stars 2 forks source link

API #52

Closed phiweger closed 7 years ago

phiweger commented 7 years ago

specify arguments and then transform gb record to json

zoo in --ncbi "txid64320[Organism:noexp]" \
    --client "localhost:27017" \
    --db "flavi" \
    --collection "zika" 

zoo in --json file.json --config settings.yaml

zoo in --dat 32234link ...
zoo in --ebi "REST API query" ...

# or import/ export?
phiweger commented 7 years ago

Neither "in" nor "import" as at some point we'd have to specify def in() or def import() which overrides Python built-ins (which just intuitively does not seem a good idea.

zoo load ...
zoo unload/ dump (in accordance w/ json module) ...
phiweger commented 7 years ago
zoo load ...
zoo dump ... (more explicit, unload implies undoing the loading, which seems odd)
phiweger commented 7 years ago
zoo load --json ...
zoo load --ncbi ...
zoo load --ebi ...
zoo load --dat ...

zoo dump --fasta file.fasta # dump entire db, default: only UUID exported to fasta header
zoo dump --fields ... --ids ... --json file.json  # select fields and ids
zoo dump --query q.json ...  # or pass a valid mongodb query directly
zoo dump --pipeline pl.json ...  # same goes for pipelines
dat share .  # to share

zoo sample ... --fasta file.fasta  # code for --fasta, --query etc. recycled

# do MSA using Mafft
zoo msa --attach alignment.mafft.fa "derivative.msa"
zoo msa --reconstruct "ID" --out alignment.mafft.fa

# or align against some reference
zoo sam --attach alignment.sam "derivative.msa"  # note the acronym: sam, msa, + 1
zoo sam --reconstruct "ID" --out alignment.sam

# FastML, RAxML refinement
zoo tree --attach tree.phylip
zoo tree --reconstruct "ID" --out tree.phylip

# minhash
# select, sample to fasta
sourmash compute ...
zoo minhash --attach sourmash.sig
zoo  minhash --sbt prefix --collections "list,of,collections"
zoo  minhash --sbt prefix --query q.json
phiweger commented 7 years ago

transferred to main README