unipept pept2lca
Returns the taxonomic lowest common ancestor for a given tryptic peptide.
The unipept pept2lca
command takes one or more tryptic peptides as input and returns the taxonomic lowest common ancestor (LCA) for each of them as output. The LCA is calculated from all taxa associated with the UniProt entries that contain the given peptide. All this information is fetched by doing API-requests to the Unipept server.
Input
The unipept pept2lca
command expects tryptic peptides as input. The source of this input can be command line arguments, a file, or standard input. If input is supplied using multiple sources at the same time, the order of priority as described above is used.
Command line arguments
If input is supplied using command line arguments, the peptides must be separated by spaces.
Example
$ unipept pept2lca AALTER MDGTEYIIVK peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank MDGTEYIIVK,1263,Ruminococcus,genus
File input
Use the --input parameter to specify a file to use as input. If input is supplied using a file, a single peptide per line is expected.
Example
$ cat input.txt AALTER MDGTEYIIVK $ unipept pept2lca --input input.txt peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank MDGTEYIIVK,1263,Ruminococcus,genus
Standard input
If the command is run without arguments and no file is specified, unipept pept2lca
will read its input from standard input. When standard input is used, a single peptide per line is expected.
Example
$ cat input.txt AALTER MDGTEYIIVK $ cat input | unipept pept2lca peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank MDGTEYIIVK,1263,Ruminococcus,genus
Output
The unipept pept2lca
command outputs the taxonomic lowest common ancestor (LCA) for each of the (tryptic) input peptides that were found in the Unipept database. By default, the NCBI taxon id, taxon name and taxonomic rank of the LCA are returned. By using the --all parameter, this can be supplemented with the full taxonomic lineage of the LCA. Consult the API documentation for a detailed list of output fields. A selection of output fields can be specified with the --select parameter. By default, output is generated in csv format. By using the --format parameter, the format can be changed into json or xml. The output can be written to a file or to standard output.
File output
Use the --output parameter to specify an output file. If the file aready exists, the output will be appended to the end of the file.
$ unipept pept2lca --output output.txt AALTER MDGTEYIIVK $ cat output.txt peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank MDGTEYIIVK,1263,Ruminococcus,genus
Standard output
If no output file is specified, unipept pept2lca
will write its output to standard output.
Example
$ unipept pept2lca AALTER MDGTEYIIVK peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank MDGTEYIIVK,1263,Ruminococcus,genus $ unipept pept2lca AALTER MDGTEYIIVK > output.txt $ cat output.txt peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank MDGTEYIIVK,1263,Ruminococcus,genus
Fasta support
The unipept pept2lca
command supports input (from any source) in a fasta-like format (for example generated by the prot2pept command). This format consists of a fasta header (a line starting with a >), followed by one or more lines containing one peptide each. When this format is detected, the output will automatically include an extra information field containing the corresponding fasta header.
Example
$ cat input.txt > header 1 AALTER MDGTEYIIVK > header 2 AALTER $ unipept pept2lca --input input.txt fasta_header,peptide,taxon_id,taxon_name,taxon_rank > header 1,AALTER,1,root,no rank > header 1,MDGTEYIIVK,1263,Ruminococcus,genus > header 2,AALTER,1,root,no rank
Command-line options
--equate / -e Equate isoleucine and leucine
If the --equate
flag is set, isoleucine (I) and leucine (L) are equated when matching tryptic peptides to UniProt entries. This is similar to checking the Equate I and L? checkbox when performing a search in the Unipept web interface.
Example
$ unipept pept2lca LGAALGAGLAVIGAGIGIGK peptide,taxon_id,taxon_name,taxon_rank LGAALGAGLAVIGAGIGIGK,817,Bacteroides fragilis,species $ unipept pept2lca --equate LGAALGAGLAVIGAGIGIGK peptide,taxon_id,taxon_name,taxon_rank LGAALGAGLAVIGAGIGIGK,171549,Bacteroidales,order
--input / -i Specify an input file
All Unipept CLI commands can process input from 3 sources: command line arguments, a file, or standard input. The optional --input
option allows you to specify an input file. The file should contain a single peptide per line.
Example
$ cat input.txt AALTER OMGWTFBBQ MDGTEYIIVK $ unipept pept2lca --input input.txt peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank MDGTEYIIVK,1263,Ruminococcus,genus
--output / -o Specify an output file
By default, the unipept commands write their output to standard output. Using the optional --output
option allows you to specify a file to write the output to. If the file already exists, the output will be appended; if it doesn't, a new file will be created.
Example
$ unipept pept2lca --output output.txt AALTER $ cat output.txt peptide,taxon_id,taxon_name,taxon_rank AALTER,1,root,no rank
--select / -s Specify the output fields
By default, the Unipept CLI commands output all information fields received from the Unipept server. The --select
option allows you to control which fields are returned. A list of fields can be specified by a comma-separated list, or by using multiple --select
options. A * can be used as a wildcard for field names. For example, --select peptide,taxon*
will return the peptide field and all fields starting with taxon.
Example
$ unipept pept2lca --select peptide,taxon_id AALTER peptide,taxon_id AALTER,1 $ unipept pept2lca --select peptide --select *name AALTER peptide,taxon_name AALTER,root
--format / -f Specify the output format
By default, the Unipept CLI commands return their output in csv format. The --format
option allows you to select another format. Supported formats are csv, json, and xml.
Example
$ unipept pept2lca --format json AALTER MDGTEYIIVK [{"peptide":"AALTER","taxon_id":1,"taxon_name":"root","taxon_rank":"no rank"},{"peptide":"MDGTEYIIVK","taxon_id":1263,"taxon_name":"Ruminococcus","taxon_rank":"genus"}] $ unipept pept2lca --format xml AALTER MDGTEYIIVK <results><result><peptide>AALTER</peptide><taxon_id>1</taxon_id><taxon_name>root</taxon_name><taxon_rank>no rank</taxon_rank></result><result><peptide>MDGTEYIIVK</peptide><taxon_id>1263</taxon_id><taxon_name>Ruminococcus</taxon_name><taxon_rank>genus</taxon_rank></result></results>
--all / -a Request additional information
By default, the Unipept CLI commands only request basic information from the Unipept server. By using the --all
flag, you can request additional information fields such as the lineage of the returned taxa. You can use the --select
option to select which fields are included in the output.
Performance penalty
Setting --all
has a performance penalty inferred from additional database queries. Do not use this option unless the extra information fields are strictly needed.
Example
$ unipept pept2lca --all --select peptide,taxon_id,order* MDGTEYIIVK peptide,taxon_id,order_id,order_name MDGTEYIIVK,1263,186802,Clostridiales
--help / -h Display help
This flag displays the help.