| wordcount

## Wiki

The master copies of EMBOSS documentation are available at http://emboss.open-bio.org/wiki/Appdocs on the EMBOSS Wiki.

Please help by correcting and extending the Wiki pages.

## Function

Count and extract unique words in molecular sequence(s)

## Description

wordcount counts and extracts all possible unique sequence words of a specified size in one or more DNA sequences. It writes an output file giving all possible words for that word size with a count of each word in the input sequences. Optionally, only words occuring a specified minimum number of times are reported.

## Usage

Here is a sample session with wordcount

    % wordcount tembl:u68037 -wordsize=3
    Count and extract unique words in molecular sequence(s)
    Output file [u68037.wordcount]:

Go to the input files for this example
Go to the output files for this example

## Command line arguments

    Count and extract unique words in molecular sequence(s)
    Version: EMBOSS:6.6.0.0

       Standard (Mandatory) qualifiers:
      [-sequence]          seqall     Sequence(s) filename and optional format, or
                                      reference (input USA)
       -wordsize           integer    [@($(acdprotein)? 2 : 4)] Word size (Integer
                                      1 or more)
      [-outfile]           outfile    [*.wordcount] Output file name

       Additional (Optional) qualifiers:
       -mincount           integer    [1] Minimum word count to report (Integer 1
                                      or more)

       Advanced (Unprompted) qualifiers: (none)
       Associated qualifiers:

       "-sequence" associated qualifiers
       -sbegin1            integer    Start of each sequence to be used
       -send1              integer    End of each sequence to be used
       -sreverse1          boolean    Reverse (if DNA)
       -sask1              boolean    Ask for begin/end/reverse
       -snucleotide1       boolean    Sequence is nucleotide
       -sprotein1          boolean    Sequence is protein
       -slower1            boolean    Make lower case
       -supper1            boolean    Make upper case
       -scircular1         boolean    Sequence is circular
       -squick1            boolean    Read id and sequence only
       -sformat1           string     Input sequence format
       -iquery1            string     Input query fields or ID list
       -ioffset1           integer    Input start position offset
       -sdbname1           string     Database name
       -sid1               string     Entryname
       -ufo1               string     UFO features
       -fformat1           string     Features format
       -fopenfile1         string     Features file name

       "-outfile" associated qualifiers
       -odirectory2        string     Output directory

       General qualifiers:
       -auto               boolean    Turn off prompts
       -stdout             boolean    Write first file to standard output
       -filter             boolean    Read first file from standard input, write
                                      first file to standard output
       -options            boolean    Prompt for standard and additional values
       -debug              boolean    Write debug output to program.dbg
       -verbose            boolean    Report some/full command line options
       -help               boolean    Report command line options and exit. More
                                      information on associated and general
                                      qualifiers can be found with -help -verbose
       -warning            boolean    Report warnings
       -error              boolean    Report errors
       -fatal              boolean    Report fatal errors
       -die                boolean    Report dying program messages
       -version            boolean    Report version number and exit

Qualifier | Type | Description | Allowed values | Default
--- | --- | --- | --- | ---
Standard (Mandatory) qualifiers
[-sequence] (Parameter 1) | seqall | Sequence(s) filename and optional format, or reference (input USA) | Readable sequence(s) | Required
-wordsize | integer | Word size | Integer 1 or more | @($(acdprotein)? 2 : 4)
[-outfile] (Parameter 2) | outfile | Output file name | Output file | <*>.wordcount
Additional (Optional) qualifiers
-mincount | integer | Minimum word count to report | Integer 1 or more | 1
Advanced (Unprompted) qualifiers
(none)
Associated qualifiers
"-sequence" associated seqall qualifiers
-sbegin1 -sbegin_sequence | integer | Start of each sequence to be used | Any integer value | 0
-send1 -send_sequence | integer | End of each sequence to be used | Any integer value | 0
-sreverse1 -sreverse_sequence | boolean | Reverse (if DNA) | Boolean value Yes/No | N
-sask1 -sask_sequence | boolean | Ask for begin/end/reverse | Boolean value Yes/No | N
-snucleotide1 -snucleotide_sequence | boolean | Sequence is nucleotide | Boolean value Yes/No | N
-sprotein1 -sprotein_sequence | boolean | Sequence is protein | Boolean value Yes/No | N
-slower1 -slower_sequence | boolean | Make lower case | Boolean value Yes/No | N
-supper1 -supper_sequence | boolean | Make upper case | Boolean value Yes/No | N
-scircular1 -scircular_sequence | boolean | Sequence is circular | Boolean value Yes/No | N
-squick1 -squick_sequence | boolean | Read id and sequence only | Boolean value Yes/No | N
-sformat1 -sformat_sequence | string | Input sequence format | Any string |
-iquery1 -iquery_sequence | string | Input query fields or ID list | Any string |
-ioffset1 -ioffset_sequence | integer | Input start position offset | Any integer value | 0
-sdbname1 -sdbname_sequence | string | Database name | Any string |
-sid1 -sid_sequence | string | Entryname | Any string |
-ufo1 -ufo_sequence | string | UFO features | Any string |
-fformat1 -fformat_sequence | string | Features format | Any string |
-fopenfile1 -fopenfile_sequence | string | Features file name | Any string |
"-outfile" associated outfile qualifiers
-odirectory2 -odirectory_outfile | string | Output directory | Any string |
General qualifiers
-auto | boolean | Turn off prompts | Boolean value Yes/No | N
-stdout | boolean | Write first file to standard output | Boolean value Yes/No | N
-filter | boolean | Read first file from standard input, write first file to standard output | Boolean value Yes/No | N
-options | boolean | Prompt for standard and additional values | Boolean value Yes/No | N
-debug | boolean | Write debug output to program.dbg | Boolean value Yes/No | N
-verbose | boolean | Report some/full command line options | Boolean value Yes/No | Y
-help | boolean | Report command line options and exit. More information on associated and general qualifiers can be found with -help -verbose | Boolean value Yes/No | N
-warning | boolean | Report warnings | Boolean value Yes/No | Y
-error | boolean | Report errors | Boolean value Yes/No | Y
-fatal | boolean | Report fatal errors | Boolean value Yes/No | Y
-die | boolean | Report dying program messages | Boolean value Yes/No | Y
-version | boolean | Report version number and exit | Boolean value Yes/No | N

## Input file format

wordcount reads one or more nucleotide or protein sequnces.

The input is a standard EMBOSS sequence query (also known as a 'USA').

Major sequence database sources defined as standard in EMBOSS installations include srs:embl, srs:uniprot and ensembl

Data can also be read from sequence output in any supported format written by an EMBOSS or third-party application.

The input format can be specified by using the command-line qualifier `-sformat xxx`, where 'xxx' is replaced by the name of the required format. The available format names are: gff (gff3), gff2, embl (em), genbank (gb, refseq), ddbj, refseqp, pir (nbrf), swissprot (swiss, sw), dasgff and debug.

See: http://emboss.sf.net/docs/themes/SequenceFormats.html for further information on sequence formats.

### Input files for usage example

'tembl:u68037' is a sequence entry in the example nucleic acid database 'tembl'

### Database entry: tembl:u68037

    ID   U68037; SV 1; linear; mRNA; STD; ROD; 1218 BP.
    XX
    AC   U68037;
    XX
    DT   23-SEP-1996 (Rel. 49, Created)
    DT   04-MAR-2000 (Rel. 63, Last updated, Version 2)
    XX
    DE   Rattus norvegicus EP1 prostanoid receptor mRNA, complete cds.
    XX
    KW   .
    XX
    OS   Rattus norvegicus (Norway rat)
    OC   Eukaryota; Metazoa; Chordata; Craniata; Vertebrata; Euteleostomi; Mammalia;
    OC   Eutheria; Euarchontoglires; Glires; Rodentia; Sciurognathi; Muroidea;
    OC   Muridae; Murinae; Rattus.
    XX
    RN   [1]
    RP   1-1218
    RA   Abramovitz M., Boie Y.;
    RT   "Cloning of the rat EP1 prostanoid receptor";
    RL   Unpublished.
    XX
    RN   [2]
    RP   1-1218
    RA   Abramovitz M., Boie Y.;
    RT   ;
    RL   Submitted (26-AUG-1996) to the INSDC.
    RL   Biochemistry & Molecular Biology, Merck Frosst Center for Therapeutic
    RL   Research, P. O. Box 1005, Pointe Claire - Dorval, Quebec H9R 4P8, Canada
    XX
    DR   Ensembl-GO; ENSRNOESTG00000830631; Rattus_norvegicus.
    DR   Ensembl-Gn; ENSRNOG00000004094; Rattus_norvegicus.
    DR   Ensembl-Gn; ENSRNOG00000017743; Rattus_norvegicus.
    DR   Ensembl-TO; ENSRNOESTT00000830623; Rattus_norvegicus.
    DR   Ensembl-Tr; ENSRNOT00000005470; Rattus_norvegicus.
    DR   Ensembl-Tr; ENSRNOT00000023860; Rattus_norvegicus.
    XX
    FH   Key             Location/Qualifiers
    FH
    FT   source          1..1218
    FT                   /organism="Rattus norvegicus"
    FT                   /strain="Sprague-Dawley"
    FT                   /mol_type="mRNA"
    FT                   /db_xref="taxon:10116"
    FT   CDS             1..1218
    FT                   /codon_start=1
    FT                   /product="EP1 prostanoid receptor"
    FT                   /note="family 1 G-protein coupled receptor"
    FT                   /db_xref="GOA:P70597"
    FT                   /db_xref="InterPro:IPR000276"
    FT                   /db_xref="InterPro:IPR000708"
    FT                   /db_xref="InterPro:IPR001244"
    FT                   /db_xref="InterPro:IPR008365"
    FT                   /db_xref="InterPro:IPR017452"
    FT                   /db_xref="UniProtKB/Swiss-Prot:P70597"
    FT                   /protein_id="AAB07735.1"
    FT                   /translation="MSPYGLNLSLVDEATTCVTPRVPNTSVVLPTGGNGTSPALPIFSM
    FT                   TLGAVSNVLALALLAQVAGRLRRRRSTATFLLFVASLLAIDLAGHVIPGALVLRLYTAG
    FT                   RAPAGGACHFLGGCMVFFGLCPLLLGCGMAVERCVGVTQPLIHAARVSVARARLALALL
    FT                   AAMALAVALLPLVHVGHYELQYPGTWCFISLGPPGGWRQALLAGLFAGLGLAALLAALV
    FT                   CNTLSGLALLRARWRRRRSRRFRENAGPDDRRRWGSRGLRLASASSASSITSTTAALRS
    FT                   SRGGGSARRVHAHDVEMVGQLVGIMVVSCICWSPLLVLVVLAIGGWNSNSLQRPLFLAV
    FT                   RLASWNQILDPWVYILLRQAMLRQLLRLLPLRVSAKGGPTELSLTKSAWEASSLRSSRH
    FT                   SGFSHL"
    XX
    SQ   Sequence 1218 BP; 162 A; 397 C; 387 G; 272 T; 0 other;
         atgagcccct acgggcttaa cctgagccta gtggatgagg caacaacgtg tgtaacaccc        60
         agggtcccca atacatctgt ggtgctgcca acaggcggta acggcacatc accagcgctg       120
         cctatcttct ccatgacgct gggtgctgtg tccaacgtgc tggcgctggc gctgctggcc       180
         caggttgcag gcagactgcg gcgccgccgc tcgactgcca ccttcctgtt gttcgtcgcc       240
         agcctgcttg ccatcgacct agcaggccat gtgatcccgg gcgccttggt gcttcgcctg       300
         tatactgcag gacgtgcgcc cgctggcggg gcctgtcatt tcctgggcgg ctgtatggtc       360
         ttctttggcc tgtgcccact tttgcttggc tgtggcatgg ccgtggagcg ctgcgtgggt       420
         gtcacgcagc cgctgatcca cgcggcgcgc gtgtccgtag cccgcgcacg cctggcacta       480
         gccctgctgg ccgccatggc tttggcagtg gcgctgctgc cactagtgca cgtgggtcac       540
         tacgagctac agtaccctgg cacttggtgt ttcattagcc ttgggcctcc tggaggttgg       600
         cgccaggcgt tgcttgcggg cctcttcgcc ggccttggcc tggctgcgct ccttgccgca       660
         ctagtgtgta atacgctcag cggcctggcg ctccttcgtg cccgctggag gcggcgtcgc       720
         tctcgacgtt tccgagagaa cgcaggtccc gatgatcgcc ggcgctgggg gtcccgtgga       780
         ctccgcttgg cctccgcctc gtctgcgtca tccatcactt caaccacagc tgccctccgc       840
         agctctcggg gaggcggctc cgcgcgcagg gttcacgcac acgacgtgga aatggtgggc       900
         cagctcgtgg gcatcatggt ggtgtcgtgc atctgctgga gccccctgct ggtattggtg       960
         gtgttggcca tcgggggctg gaactctaac tccctgcagc ggccgctctt tctggctgta      1020
         cgcctcgcgt cgtggaacca gatcctggac ccatgggtgt acatcctgct gcgccaggct      1080
         atgctgcgcc aacttcttcg cctcctaccc ctgagggtta gtgccaaggg tggtccaacg      1140
         gagctgagcc taaccaagag tgcctgggag gccagttcac tgcgtagctc ccggcacagt      1200
         ggcttcagcc acttgtga                                                    1218
    //

## Output file format

### Output files for usage example

### File: u68037.wordcount

    ctg	54
    gcc	53
    tgg	53
    ggc	51
    gct	47
    cgc	47
    gtg	40
    tgc	39
    cct	38
    gcg	36
    cca	29
    ggg	26
    tcc	25
    ctt	25
    cag	25
    ccc	24
    ggt	24
    ctc	23
    tgt	23
    ccg	22
    gca	22
    cgt	22
    cac	22
    agc	21
    ttg	19
    acg	19
    cgg	19
    tcg	18
    ttc	17
    cat	17
    agg	17
    gag	16
    act	16
    gtc	16
    aac	15
    tct	14
    atc	14
    gga	14
    tca	13
    cta	13
    atg	12
    acc	11
    gta	11
    gtt	11
    aca	10
    tga	10
    caa	10
    tac	10
    gac	9
    tag	9
    agt	9
    ttt	8
    cga	7
    gat	6
    taa	6
    aga	5
    tat	5
    gaa	4
    aat	3
    tta	3
    ata	3
    att	3
    aag	2
    aaa	1

The file simply consists of two columns, separated by spaces or TAB characters.

The first column consists of all the possible words of size wordsize. The second column consists of the count of those words in the input sequence.

## Data files

None.

## Notes

None.

## References

None.

## Warnings

None.

## Diagnostic Error Messages

None.

## Exit status

0 if successful.

## Known bugs

None.

## See also

Program name | Description
--- | ---
backtranambig | Back-translate a protein sequence to ambiguous nucleotide sequence
backtranseq | Back-translate a protein sequence to a nucleotide sequence
banana | Plot bending and curvature data for B-DNA
btwisted | Calculate the twisting in a B-DNA sequence
chaos | Draw a chaos game representation plot for a nucleotide sequence
compseq | Calculate the composition of unique words in sequences
dan | Calculate nucleic acid melting temperature
density | Draw a nucleic acid density plot
emowse | Search protein sequences by digest fragment molecular weight
freak | Generate residue/base frequency table or plot
isochore | Plot isochores in DNA sequences
mwcontam | Find weights common to multiple molecular weights files
mwfilter | Filter noisy data from molecular weights file
oddcomp | Identify proteins with specified sequence word composition
pepdigest | Report on protein proteolytic enzyme or reagent cleavage sites
pepinfo | Plot amino acid properties of a protein sequence in parallel
pepstats | Calculate statistics of protein properties

## Author(s)

Ian Longden formerly at:
Sanger Institute, Wellcome Trust Genome Campus, Hinxton, Cambridge, CB10 1SA, UK.

Please report all bugs to the EMBOSS bug team (emboss-bug © emboss.open-bio.org) not to the original author.

## History

Completed 27th November 1998.

## Target users

This program is intended to be used by everyone and everything, from naive users to embedded scripts.

## Comments

None