The unipept pept2taxa command takes one or more tryptic peptides as input and returns the set of (NCBI) taxa extracted from the UniProt entries containing the peptides as output. This information is fetched by doing API-requests to the Unipept server.

Input

The unipept pept2taxa 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 pept2taxa MFNEIAPK ISVAQGASK
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species

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
MFNEIAPK
ISVAQGASK
$ unipept pept2taxa --input input.txt
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species

Standard input

If the command is run without arguments and no file is specified, unipept pept2taxa will read its input from standard input. When standard input is used, a single peptide per line is expected.

Example
$ cat input.txt
MFNEIAPK
ISVAQGASK
$ cat input | unipept pept2taxa
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species

Output

The unipept pept2taxa command outputs all NCBI taxonomy entries that are associated with UniProt entries that contain the given (tryptic) input peptides. By default, for each of the taxa, the NCBI taxon id, the name of the organism and the taxonomic rank are returned. By using the --all parameter, this can be supplemented with the full taxonomic lineage of the taxon. 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 pept2taxa --output output.txt MFNEIAPK ISVAQGASK
$ cat output.txt
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species

Standard output

If no output file is specified, unipept pept2taxa will write its output to standard output.

Example
$ unipept pept2taxa MFNEIAPK ISVAQGASK
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species
$ unipept pept2taxa MFNEIAPK ISVAQGASK > output.txt
$ cat output.txt
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species

Fasta support

The unipept pept2taxa 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
ISVAQGASK
MFNEIAPK
> header 2
ISVAQGASK
$ unipept pept2taxa --input input.txt
fasta_header,peptide,taxon_id,taxon_name,taxon_rank
> header 1,ISVAQGASK,9606,Homo sapiens,species
> header 1,MFNEIAPK,1262758,Blautia sp. CAG:52,species
> header 1,MFNEIAPK,1262948,Roseburia sp. CAG:471,species
> header 2,ISVAQGASK,9606,Homo sapiens,species

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 pept2taxa FEALLGDGSQYGLHLQYK
peptide,taxon_id,taxon_name,taxon_rank
FEALLGDGSQYGLHLQYK,408170,human gut metagenome,species
FEALLGDGSQYGLHLQYK,411471,Subdoligranulum variabile DSM 15176,no rank
$ unipept pept2taxa --equate FEALLGDGSQYGLHLQYK
peptide,taxon_id,taxon_name,taxon_rank
FEALLGDGSQYGLHLQYK,408170,human gut metagenome,species
FEALLGDGSQYGLHLQYK,411471,Subdoligranulum variabile DSM 15176,no rank
FEALLGDGSQYGLHLQYK,411483,Faecalibacterium prausnitzii A2-165,no rank
FEALLGDGSQYGLHLQYK,411485,Faecalibacterium prausnitzii M21/2,no rank
FEALLGDGSQYGLHLQYK,657322,Faecalibacterium prausnitzii SL3/3,no rank
FEALLGDGSQYGLHLQYK,718252,Faecalibacterium prausnitzii L2-6,no rank
FEALLGDGSQYGLHLQYK,748224,Faecalibacterium cf. prausnitzii KLE1255,no rank
FEALLGDGSQYGLHLQYK,1262898,Faecalibacterium sp. CAG:82,species

--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
MFNEIAPK
OMGWTFBBQ
ISVAQGASK
$ unipept pept2taxa --input input.txt
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species

--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 pept2taxa --output output.txt MFNEIAPK ISVAQGASK
$ cat output.txt
peptide,taxon_id,taxon_name,taxon_rank
MFNEIAPK,1262758,Blautia sp. CAG:52,species
MFNEIAPK,1262948,Roseburia sp. CAG:471,species
ISVAQGASK,9606,Homo sapiens,species

--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 pept2taxa --select peptide,taxon_id MFNEIAPK
peptide,taxon_id
MFNEIAPK,1262758
MFNEIAPK,1262948
$ unipept pept2taxa --select peptide --select *name MFNEIAPK
peptide,taxon_name
MFNEIAPK,Blautia sp. CAG:52
MFNEIAPK,Roseburia sp. CAG:471

--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 pept2taxa --format json ISVAQGASK MFNEIAPK
[{"peptide":"ISVAQGASK","taxon_id":9606,"taxon_name":"Homo sapiens","taxon_rank":"species"},{"peptide":"MFNEIAPK","taxon_id":1262758,"taxon_name":"Blautia sp. CAG:52","taxon_rank":"species"},{"peptide":"MFNEIAPK","taxon_id":1262948,"taxon_name":"Roseburia sp. CAG:471","taxon_rank":"species"}]
$ unipept pept2taxa --format xml ISVAQGASK MFNEIAPK
<results><result><peptide>ISVAQGASK</peptide><taxon_id>9606</taxon_id><taxon_name>Homo sapiens</taxon_name><taxon_rank>species</taxon_rank></result><result><peptide>MFNEIAPK</peptide><taxon_id>1262758</taxon_id><taxon_name>Blautia sp. CAG:52</taxon_name><taxon_rank>species</taxon_rank></result><result><peptide>MFNEIAPK</peptide><taxon_id>1262948</taxon_id><taxon_name>Roseburia sp. CAG:471</taxon_name><taxon_rank>species</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 pept2taxa --all --select peptide,taxon_id,order* ISVAQGASK MFNEIAPK
peptide,taxon_id,order_id,order_name
ISVAQGASK,9606,9443,Primates
MFNEIAPK,1262758,186802,Clostridiales
MFNEIAPK,1262948,186802,Clostridiales

--help / -h Display help

This flag displays the help.