Sponsored Content
Top Forums Shell Programming and Scripting Counting the number of element in each column Post 302874791 by Homa on Sunday 17th of November 2013 06:28:04 AM
Old 11-17-2013
Oops, sorry for posting this, I found my mistake:

Code:
awk '{count[$1]++} END{for (genes in count) { print genes, count[genes]}}' file

 

10 More Discussions You Might Find Interesting

1. Linux

counting the number of lines

Hello, I have afile which begins with a few urls on multiple lines and then there is listing of some information on separate lines. The listing begins with the word Name on a given line followed by teh actual list. I want to count the number of lines in this file after the line having... (6 Replies)
Discussion started by: nayeemmz
6 Replies

2. UNIX for Dummies Questions & Answers

Counting number of occurences

Hi All, I have to count the number of occurences of the character " ; " in a given line. I had used the following awk command to achieve the same echo $KOP.dat|awk '{split($1,my,";"); for(i in my)c++ }END{print c-1}' My file KOP.dat had the following data ... (1 Reply)
Discussion started by: kingofprussia
1 Replies

3. Shell Programming and Scripting

counting the number of lines - again

Hi all, I use bash shell and I have a problem with wc. I would like to determine the number of lines in a file so I do wc -l filename but I don't want to get the filename again I just would like to have the number of lines and use it in a variable. Can anybody help? Thank you, (7 Replies)
Discussion started by: f_o_555
7 Replies

4. Shell Programming and Scripting

counting the number of occurences

say i've got a text file with >10million sequences: ssss ssss tttttt uuuuuu uuuuuu uuuuuu ... I'd like to convert the file so that the output will report the number of occurence right by each sequence: 2 ssss 2 ssss 1 tttttt 3 uuuuuu 3 uuuuuu 3 uuuuuu .... (3 Replies)
Discussion started by: johjoh
3 Replies

5. Shell Programming and Scripting

counting number of sentence

Hi all I want to count total numbers of sentences separated by fullstop (.) in different files under a directory at one go. Any help is appreciated. (3 Replies)
Discussion started by: my_Perl
3 Replies

6. Shell Programming and Scripting

Counting the number of characters

Hi all, Can someone help me in getting the following o/p I/p:... (7 Replies)
Discussion started by: Sri3001
7 Replies

7. Shell Programming and Scripting

Print the row element till the next row element appear in a column

Hi all I have file with columns F3 pathway CPS F2 H2 H4 H5 H6 no pathway CMP H7 H8 H9 H10 My expected output is F3 pathway CPS F2 pathway CPS (10 Replies)
Discussion started by: Priyanka Chopra
10 Replies

8. Shell Programming and Scripting

Counting a consecutive number in column 2

Hi, I have a input file which contains following data 0 1 0 2 0 3 0 4 0 8 0 9 0 11 1 1 1 2 1 6 1 7 1 8 1 9 2 1 2 11 2 12 (12 Replies)
Discussion started by: Ryan Kim
12 Replies

9. Shell Programming and Scripting

Help: Counting values less than a number

So I have several files (35000, to be exact) in the format rmsd_protein_*.dat each with 2 columns and 35000 rows. I would like to count how many values in the second column are less than 3 for each file, and output it into a new file so that it ultimately appears as: 1 14057 2 ... (12 Replies)
Discussion started by: Alexandryne
12 Replies

10. Shell Programming and Scripting

Adding character and append last element of second column

Hi, could you help me in processing this file under bash? I need to add some text to the first line and then append the last element of the second columns. The input file is tab separated while the output should be space separated. input file is 1.00E-02 2.00E-02 4.465E+17 2.00E-02 3.00E-02... (4 Replies)
Discussion started by: f_o_555
4 Replies
LONG-ORFS(1)						      General Commands Manual						      LONG-ORFS(1)

NAME
long-orfs -- Find/Score potential genes in genome-file using the probability model in icm-file SYNOPSIS
tigr-long-orgs [genome-file options] DESCRIPTION
Program long-orfs takes a sequence file (in FASTA format) and outputs a list of all long "potential genes" in it that do not overlap by too much. By "potential gene" I mean the portion of an orf from the first start codon to the stop codon at the end. The first few lines of output specify the settings of various parameters in the program: Minimum gene length is the length of the smallest fragment considered to be a gene. The length is measured from the first base of the start codon to the last base *before* the stop codon. This value can be specified when running the program with the -g option. By default, the program now (April 2003) will compute an optimal length for this parameter, where "optimal" is the value that produces the greatest number of long ORFs, thereby increasing the amount of data used for training. Minimum overlap length is a lower bound on the number of bases overlap between 2 genes that is considered a problem. Overlaps shorter than this are ignored. Minimum overlap percent is another lower bound on the number of bases overlap that is considered a problem. Overlaps shorter than this percentage of *both* genes are ignored. The next portion of the output is a list of potential genes: Column 1 is an ID number for reference purposes. It is assigned sequentially starting with 1 to all long potential genes. If overlap- ping genes are eliminated, gaps in the numbers will occur. The ID prefix is specified in the constant ID_PREFIX . Column 2 is the position of the first base of the first start codon in the orf. Currently I use atg, and gtg as start codons. This is easily changed in the function Is_Start () . Column 3 is the position of the last base *before* the stop codon. Stop codons are taa, tag, and tga. Note that for orfs in the reverse reading frames have their start position higher than the end position. The order in which orfs are listed is in increasing order by Max {OrfStart, End}, i.e., the highest numbered position in the orf, except for orfs that "wrap around" the end of the sequence. When two genes with ID numbers overlap by at least a sufficient amount (as determined by Min_Olap and Min_Olap_Percent ), they are elimi- nated and do not appear in the output. The final output of the program (sent to the standard error file so it does not show up when output is redirected to a file) is the length of the longest orf found. Specifying Different Start and Stop Codons: To specify different sets of start and stop codons, modify the file gene.h . Specifically, the functions: Is_Forward_Start Is_Reverse_Start Is_Start Is_Forward_Stop Is_Reverse_Stop Is_Stop are used to determine what is used for start and stop codons. Is_Start and Is_Stop do simple string comparisons to specify which patterns are used. To add a new pattern, just add the comparison for it. To remove a pattern, comment out or delete the comparison for it. The other four functions use a bit comparison to determine start and stop patterns. They represent a codon as a 12-bit pattern, with 4 bits for each base, one bit for each possible value of the bases, T, G, C or A. Thus the bit pattern 0010 0101 1100 represents the base pattern [C] [A or G] [G or T]. By doing bit operations (& | ~) and comparisons, more complicated patterns involving ambiguous reads can be tested efficiently. Simple patterns can be tested as in the current code. For example, to insert an additional start codon of CAT requires 3 changes: 1. The line || (Codon & 0x218) == Codon should be inserted into Is_Forward_Start , since 0x218 = 0010 0001 1000 represents CAT. 2. The line || (Codon & 0x184) == Codon should be inserted into Is_Reverse_Start , since 0x184 = 0001 1000 0100 represents ATG, which is the reverse-complement of CAT. Alternately, the #define constant ATG_MASK could be used. 3. The line || strncmp (S, "cat", 3) == 0 should be inserted into Is_Start . OPTIONS
-g n Set minimum gene length to n. Default is to compute an optimal value automatically. Don't change this unless you know what you're doing. -l Regard the genome as linear (not circular), i.e., do not allow genes to "wrap around" the end of the genome. This option works on both glimmer and long-orfs . The default behavior is to regard the genome as circular. -o n Set maximum overlap length to n. Overlaps shorter than this are permitted. (Default is 0 bp.) -p n Set maximum overlap percentage to n%. Overlaps shorter than this percentage of *both* strings are ignored. (Default is 10%.) SEE ALSO
tigr-glimmer3 (1), tigr-adjust (1), tigr-anomaly (1), tigr-build-icm (1), tigr-check (1), tigr-codon-usage (1), tigr-compare-lists (1), tigr-extract (1), tigr-generate (1), tigr-get-len (1), tigr-get-putative (1), http://www.tigr.org/software/glimmer/ Please see the readme in /usr/share/doc/tigr-glimmer for a description on how to use Glimmer3. AUTHOR
This manual page was quickly copied from the glimmer web site by Steffen Moeller moeller@debian.org for the Debian system. LONG-ORFS(1)
All times are GMT -4. The time now is 03:06 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy