RESTful API for getting GFE results from raw sequence data
Further documentation is available at service-gfe-submission.readthedocs.io.
The Gene Feature Enumeration (GFE) Submission service provides an API for converting raw sequence data to GFE. It provides both a RESTful API and a simple user interface for converting raw sequence data to GFE results. Sequences can be submitted one at a time or as a fasta file. This service uses nmdp-bioinformatics/service-feature for encoding the raw sequence data and nmdp-bioinformatics/HSA for aligning the raw sequence data. A public version of this service is available for use at gfe.b12x.org.
# Get GFE from sequence data - in body #
curl --header "Content-type: application/json" --request POST \
--data '{"locus":"HLA-A","sequence":"TCCCCAGACGCCGAGGATGGCCGTCATGGCGCCCCGAACCCTCCTCCTGCTACTCTCGGGGGCCCTGGCCCTGACCCAGACCTGGGCGGGTGAGTGCGGGGTCGGGAGGGAAACCGCCTCTGCGGGGAGAAGCAAGGGGCCCTCCTGGCGGGGGCGCAGGACCGGGGGAGCCGCGCCGGGACGAGGGTCGGGCAGGTCTCAGCCACTGCTCGCCCCCAGGCTCCCACTCCATGAGGTATTTCTTCACATCCGTGTCCCGGCCCGGCCGCGGGGAGCCCCGCTTCATCGCCGTGGGCTACGTGGACGACACGCAGTTCGTGCGGTTCGACAGCGACGCCGCGAGCCAGAGGATGGAGCCGCGGGCGCCGTGGATAGAGCAGGAGGGGCCGGAGTATTGGGACCAGGAGACACGGAATGTGAAGGCCCAGTCACAGACTGACCGAGTGGACCTGGGGACCCTGCGCGGCTACTACAACCAGAGCGAGGCCGGTGAGTGACCCCGGCCGGGGGCGCAGGTCAGGACCCCTCATCCCCCACGGACGGGCCAGGTCGCCCACAGTCTCCGGGTCCGAGATCCACCCCGAAGCCGCGGGACCCCGAGACCCTTGCCCCGGGAGAGGCCCAGGCGCCTTTACCCGGTTTCATTTTCAGTTTAGGCCAAAAATCCCCCCGGGTTGGTCGGGGCTGGGCGGGGCTCGGGGGACTGGGCTGACCGCGGGGTCGGGGCCAGGTTCTCACACCATCCAGATAATGTATGGCTGCGACGTGGGGTCGGACGGGCGCTTCCTCCGCGGGTACCGGCAGGACGCCTACGACGGCAAGGATTACATCGCCCTGAACGAGGACCTGCGCTCTTGGACCGCGGCGGACATGGCGGCTCAGATCACCAAGCGCAAGTGGGAGGCGGCCCATGAGGCGGAGCAGTTGAGAGCCTACCTGGATGGCACGTGCGTGGAGTGGCTCCGCAGATACCTGGAGAACGGGAAGGAGACGCTGCAGCGCACGGGTACCAGGGGCCACGGGGCGCCTCCCTGATCGCCTGTAGATCTCCCGGGCTGGCCTCCCACAAGGAGGGGAGACAATTGGGACCAACACTAGAATATCACCCTCCCTCTGGTCCTGAGGGAGAGGAATCCTCCTGGGTTCCAGATCCTGTACCAGAGAGTGACTCTGAGGTTCCGCCCTGCTCTCTGACACAATTAAGGGATAAAATCTCTGAAGGAGTGACGGGAAGACGATCCCTCGAATACTGATGAGTGGTTCCCTTTGACACCGGCAGCAGCCTTGGGCCCGTGACTTTTCCTCTCAGGCCTTGTTCTCTGCTTCACACTCAATGTGTGTGGGGGTCTGAGTCCAGCACTTCTGAGTCCCTCAGCCTCCACTCAGGTCAGGACCAGAAGTCGCTGTTCCCTTCTCAGGGAATAGAAGATTATCCCAGGTGCCTGTGTCCAGGCTGGTGTCTGGGTTCTGTGCTCTCTTCCCCATCCCGGGTGTCCTGTCCATTCTCAAGATGGCCACATGCGTGCTGGTGGAGTGTCCCATGACAGATGCAAAATGCCTGAATTTTCTGACTCTTCCCGTCAGACCCCCCCAAGACACATATGACCCACCACCCCATCTCTGACCATGAGGCCACCCTGAGGTGCTGGGCCCTGGGCTTCTACCCTGCGGAGATCACACTGACCTGGCAGCGGGATGGGGAGGACCAGACCCAGGACACGGAGCTCGTGGAGACCAGGCCTGCAGGGGATGGAACCTTCCAGAAGTGGGCGGCTGTGGTGGTGCCTTCTGGAGAGGAGCAGAGATACACCTGCCATGTGCAGCATGAGGGTCTGCCCAAGCCCCTCACCCTGAGATGGGGTAAGGAGGGAGATGGGGGTGTCATGTCTCTTAGGGAAAGCAGGAGCCTCTCTGGAGACCTTTAGCAGGGTCAGGGCCCCTCACCTTCCCCTCTTTTCCCAGAGCTGTCTTCCCAGCCCACCATCCCCATCGTGGGCATCATTGCTGGCCTGGTTCTCCTTGGAGCTGTGATCACTGGAGCTGTGGTCGCTGCCGTGATGTGGAGGAGGAAGAGCTCAGGTGGAGAAGGGGTGAAGGGTGGGGTCTGAGATTTCTTGTCTCACTGAGGGTTCCAAGCCCCAGCTAGAAATGTGCCCTGTCTCATTACTGGGAAGCACCGTCCACAATCATGGGCCTACCCAGTCTGGGCCCCGTGTGCCAGCACTTACTCTTTTGTAAAGCACCTGTTAAAATGAAGGACAGATTTATCACCTTGATTACGGCGGTGATGGGACCTGATCCCAGCAGTCACAAGTCACAGGGGAAGGTCCCTGAGGACAGACCTCAGGAGGGCTATTGGTCCAGGACCCACACCTGCTTTCTTCATGTTTCCTGATCCCGCCCTGGGTCTGCAGTCACACATTTCTGGAAACTTCTCTGGGGTCCAAGACTAGGAGGTTCCTCTAGGACCTTAAGGCCCTGGCTCCTTTCTGGTATCTCACAGGACATTTTCTTCTCACAGATAGAAAAGGAGGGAGTTACACTCAGGCTGCAAGTAAGTATGAAGGAGGCTGATGCCTGAGGTCCTTGGGATATTGTGTTTGGGAGCCCATGGGGGAGCTCACCCACCTCACAATTCCTCCTCTAGCCACATCTTCTGTGGGATCTGACCAGGTTCTGTTTTTGTTCTACCCCAGGCAGTGACAGTGCCCAGGGCTCTGATGTGTCCCTCACAGCTTGTAAAGGTGAGAGCTTGGAGGACCTAATGTGTGTTGGGTGTTGGGCGGAACAGTGGACACAGCTGTGCTATGGGGTTTCTTTGCATTGGATGTATTGAGCATGCGATGGGCTGTTTAAGGTGTGACCCCTCACTGTGATGGATATGAATTTGTTCATGAATATTTTTTTCTATAGTGTGAGACAGCTGCCTTGTGTGGGACTGAG"}' \
http://gfe.b12x.org/gfe
# Sequence from GFE #
curl --header "Content-type: application/json" --request POST \
--data '{"locus":"HLA-A","gfe":"HLA-Aw1-1-7-20-10-32-7-1-1-1-6-1-5-3-5-1-0"}' \
http://gfe.b12x.org/sequence
# Get GFE from fasta file #
curl -F "verbose=1" -F "locus=HLA-A" \
-F "file=@GFE_Submission/public/downloads/FastaTest.fasta" \
http://gfe.b12x.org/fasta
# Get GFE from HML file #
curl -F "verbose=1" \
-F "file=@GFE_Submission/public/downloads/HmlTest.HML" \
http://gfe.b12x.org/hml
# Get HML file with GFE from HML #
curl -F "verbose=1" -F "type=xml" \
-F "file=@GFE_Submission/public/downloads/HmlTest.HML" \
http://gfe.b12x.org/hml
# Get HML file with GFE from HML using nextflow #
# Faster than /hml but can not provide structures #
curl -F "verbose=1" \
-F "file=@GFE_Submission/public/downloads/HmlTest.HML" \
http://gfe.b12x.org/flowhml
The easiest way to get the service running locally, is to pull an image containing the service from docker hub. Running the following command will pull the latest GFE service image from docker hub. The image on docker hub is built from the Dockerfile in the docker directory in the github repository. Every new commit to the nmdp-bioinformatics/service-gfe-submission repository triggers a new build of the docker image on docker hub.
docker pull nmdpbioinformatics/service-gfe-submission
docker run -d --name service-gfe-submission -p 8080:5050 nmdpbioinformatics/service-gfe-submission
The -d flag runs the service in "detached-mode" in the background and -p specifies what ports to expose. Make sure the ports you expose are not already in use. If the docker container is successfuly executed then typing docker ps -a
will show a new container labeled service-gfe-submission running.
Click here for more information on the publically available docker image.
#!/usr/bin/env perl
use strict;
use warnings;
use GFE_Client;
my $s_seq = shift @ARGV;
my $s_locus = shift @ARGV;
# Does alignment of sequence and submission of aligned
# sequence to the GFE service.
my $o_client = GFE_Client->new();
my $rh_gfe = $o_client->getGfe($s_locus,$s_seq);
# Print out GFE
print $$rh_gfe{gfe},"\n";
if (!is.installed('gfeClient')){
library(devtools)
install_github('nmdp-bioinformatics/service-gfe-submission/client-R')
}
library('gfeClient')
host <- 'http://gfe.b12x.org/'
# Get GFE from fasta file
fasta.file <- 'GFE_Submission/t/resources/fastatest1.fasta'
fasta.gfe <- fasta2gfe(host,'HLA-A',fasta.file)
# Get sequence from
seq <- gfe2seq(host,'HLA-A','HLA-Aw1-1-7-20-10-32-7-1-1-1-6-1-5-3-5-1-1')
# Get GFE from sequence
gfe <- seq2gfe(host,'HLA-A',seq)
# return detailed logs
verbose <- 1
gfe <- seq2gfe(host,'HLA-A',seq,verbose)
# Return structure (ex. exon, 1 , TGCCCAAGCCCCTCACCCTGAGATGGG)
structure <- 1
gfe <- seq2gfe(host,'HLA-A',seq,verbose,structure)
./fasta2gfe [--fasta] [--locus] [--uri] [--verbose] [--help]
-f/--fasta Fasta file ** STDIN **
-u/--uri URI of feature service
-l/--locus HLA-Locus
-v/--verbose Flag for running in verbose
-h/--help
fasta2gfe --fasta t/resources/fastatest1.fasta -l HLA-A > fastatest1.gfe.csv
cat t/resources/fastatest1.fasta | fasta2gfe -l HLA-A > fastatest1.gfe.csv
./seq2gfe [--seq] [--locus] [--uri] [--verbose] [--help]
-s/--seq Sequence ** STDIN **
-u/--uri URI of feature service
-l/--locus HLA-Locus
-v/--verbose Flag for running in verbose
-h/--help
seq2gfe --seq GACGGCAAGGATTACATCGCCCTGAACGAGGACCTGCGCT \
CTTGGACCGCGGCGGACATGGCGGCTCAGATCACCAAGCGCAAGTACCTGCGCT -l HLA-A > seqtest1.gfe.csv
cat GACGGCAAGGATTACATCGCCCTGAACGAGGACCTGCGCTCTTGGACCGC \
GGCGGACATGGCGGCTCAGATCACCAAGCGCAAGTACCTGCGCTCTTGGACCGC | seq2gfe -l HLA-A > seqtest1.gfe.csv
./hml2gfe [--input] [--hml] [--uri] [--verbose] [--help]
-i/--input HML file
-u/--uri URI of feature service
-h/--hml flag for returning HML
-v/--verbose Flag for running in verbose
-h/--help
hml2gfe --input t/resources/hmltest1.HML > hmltest1.gfe.csv
hml2gfe --input t/resources/hmltest1.HML --hml > hmltest1.gfe.HML
perl cpanm --installdeps . # Install perl dependencies
perl Makefile.PL # Generate Makefile
make # Make menefest
make test # Run tests
make install # Install
plackup -E deployment \ # Deploy
-s Starman --workers=10 \
-p 5050:8080 -a bin/app.pl