Sponsored Content
Full Discussion: Counts not matching in file
Top Forums Shell Programming and Scripting Counts not matching in file Post 302960234 by cmccabe on Thursday 12th of November 2015 02:59:26 PM
Old 11-12-2015
Counts not matching in file

I can not figure out why there are 56,548 unique entries in test.bed. However, perl and awk see only 56,543 and that # is what my analysis see's as well. What happened to the 5 missing? Thank you Smilie.

The file is attached as well.

Code:
cmccabe@DTV-A5211QLM:~/Desktop/NGS/bed/bedtools$wc -l test.bed
56548 test.bed

cmccabe@DTV-A5211QLM:~/Desktop/NGS/bed/bedtools$ perl -nae '$seen{$F[3]}++;
    END{
        print "There are ", scalar keys %seen, " unique fourth fields\n";
    }' test.bed
There are 56543 unique fourth fields

cmccabe@DTV-A5211QLM:~/Desktop/NGS/bed/bedtools$ awk '$4!=d{c++;d=$4}END{print c}' test.bed
56543

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

counts

How can i do a simple record count in my shell script? i just want to count the number of records i receive from a specific file. (11 Replies)
Discussion started by: k@ssidy
11 Replies

2. Solaris

file size counts??

Hello experts, I do - $ ls -lhtr logs2007* Is it possible that i can get the results of- totals size in MB/KB for ALL "logs2007*" note: in the same directory I have "logs2006*" & "logs2007*" files. (4 Replies)
Discussion started by: thepurple
4 Replies

3. UNIX for Dummies Questions & Answers

counts

To start I have a table that has ticketholders. Each ticket holder has a unique number and each ticket holder is associated to a so called household number. You can have multiple guests w/i a household. I would like to create 3 flags (form a, for a household that has 1-4 gst) form b 5-8 gsts... (3 Replies)
Discussion started by: sbr262
3 Replies

4. Shell Programming and Scripting

Perl script that counts lines of a file

I am working on this script, but hit a bump. Looking for a little help figuring out the last part: open(MY_FILE, $ARGV) or die $COUNTER = 1; $LINE = <FILE>; while ($LINE, <FILE>) { # Adds leading zeros for numbers 1 digit long if ($COUNTER<10){ print "000"; } # Adds... (2 Replies)
Discussion started by: Breakology
2 Replies

5. Shell Programming and Scripting

Counts a number of unique word contained in the file and print them in alphabetical order

What should be the Shell script that counts a number of unique word contained in a file and print them in alphabetical order line by line? (7 Replies)
Discussion started by: proactiveaditya
7 Replies

6. UNIX for Dummies Questions & Answers

how to get distinct counts in a column of a file

If i have a file sample.txt with more than 10 columns and 11th column as following data. would it be possible to get the distinct counts of values in single shot,Thank you. Y Y N N N P P o Expected Result: Value count Y 2 N 3 P 2 (2 Replies)
Discussion started by: Ariean
2 Replies

7. UNIX for Dummies Questions & Answers

Hardcoding & Record counts in a file

HI , I am having a huge comma delimiter file, I have to append the following four lines before the starting of the file through a shell script. FILE NAME = TEST_LOAD DATETIME = CURRENT DATE TIME LOAD DATE = CURRENT DATE RECORD COUNT = TOTAL RECORDS IN FILE Source data 1,2,3,4,5,6,7... (7 Replies)
Discussion started by: shruthidwh
7 Replies

8. Shell Programming and Scripting

word counts for a single line xml file

I have any XML ouput file(file name TABLE.xml), where the data is loaded in A SINGLE LINE, I need help in writting a ksh shell script which gives me the word counts of word <TABLE-ROW> This is my input file. <?xml version="1.0" encoding="UTF-8"?><!--Generated by Ascential Software... (4 Replies)
Discussion started by: pred55
4 Replies

9. Shell Programming and Scripting

New file should store all the 7 existing filenames and their record counts and ftp th

Hi, I need help regarding below concern. There is a script and it has 7 existing files(in a path say,. usr/appl/temp/file1.txt) and I need to create one new blank file say “file_count.txt” in the same script itself. Then the new file <file_count.txt> should store all the 7 filenames and... (1 Reply)
Discussion started by: pr293
1 Replies

10. Shell Programming and Scripting

Output counts of all matching strings lessthan a number using awk

The awk below is supposed to count all the matching $5 strings and count how many $7 values is less than 20. I don't think I need the portion in bold as I do not need any decimal point or format, but can not seem to get the correct counts. Thank you :). file chr5 77316500 77316628 ... (6 Replies)
Discussion started by: cmccabe
6 Replies
Bio::FeatureIO::bed(3pm)				User Contributed Perl Documentation				  Bio::FeatureIO::bed(3pm)

NAME
Bio::FeatureIO::bed - read/write features from UCSC BED format SYNOPSIS
my $in = Bio::FeatureIO(-format => 'bed', -file => 'file.bed'); for my $feat ($in->next_feature) { # do something with $feat (a Bio::SeqFeature::Annotated object) } my $out = Bio::FeatureIO(-format=>'bed'); for my $feat ($seq->get_seqFeatures) { $out->write_feature($feat); } DESCRIPTION
See <http://www.genome.ucsc.edu/goldenPath/help/customTrack.html#BED>. Currently for read and write only the first 6 fields (chr, start, end, name, score, strand) are supported. FEEDBACK
Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to the Bioperl mailing list. Your participation is much appreciated. bioperl-l@bioperl.org - General discussion http://bioperl.org/wiki/Mailing_lists - About the mailing lists Support Please direct usage questions or support issues to the mailing list: bioperl-l@bioperl.org rather than to the module maintainer directly. Many experienced and reponsive experts will be able look at the problem and quickly address it. Please include a thorough description of the problem with code and data examples if at all possible. Reporting Bugs Report bugs to the Bioperl bug tracking system to help us keep track of the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Allen Day Email allenday@ucla.edu CONTRIBUTORS
Sendu Bala, bix@sendu.me.uk APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ _initialize Title : _initialize Function: initializes BED for reading/writing Args : all optional: name description ---------------------------------------------------------- -name the name for the BED track, stored in header name defaults to localtime() -description the description for the BED track, stored in header. defaults to localtime(). -use_score whether or not the score attribute of features should be used when rendering them. the higher the score the darker the color. defaults to 0 (false) use_score Title : use_score Usage : $obj->use_score($newval) Function: should score be used to adjust feature color when rendering? set to true if so. Example : Returns : value of use_score (a scalar) Args : on set, new value (a scalar or undef, optional) name Title : name Usage : $obj->name($newval) Function: name of BED track Example : Returns : value of name (a scalar) Args : on set, new value (a scalar or undef, optional) description Title : description Usage : $obj->description($newval) Function: description of BED track Example : Returns : value of description (a scalar) Args : on set, new value (a scalar or undef, optional) perl v5.14.2 2012-03-02 Bio::FeatureIO::bed(3pm)
All times are GMT -4. The time now is 07:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy