Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Process only 4 digit odd number starting with zero Post 303039156 by cmccabe on Tuesday 24th of September 2019 03:04:28 PM
Old 09-24-2019
Process only 4 digit odd number starting with zero

I am trying to process only IonCode_odd #'s (always 4 digits starting with zero), but the below isn't working as expected. Is there a better way? Thank you Smilie.

Code:
IonCode_0401_xxxx_xxxx_xxxx.bam
IonCode_0401_xxxx_xxxx_xxxx.bam.bai
IonCode_0401_xxxx_xxxx_xxxx.fastq
IonCode_0402_xxxx_xxxx_xxxx.bam
IonCode_0402_xxxx_xxxx_xxxx.fastq
IonCode_0407_xxxx_xxxx_xxxx.bam
IonCode_0407_xxxx_xxxx_xxxx.bam.bai
IonCode_0407_xxxx_xxxx_xxxx.fastq

desired
Code:
only IonCode_0401_xxxx_xxxx_xxxx.bam and IonCode_0407_xxxx_xxxx_xxxx.bam processed... IonCode_0402 is skipped.

Code:
md5sum /path/to/*IonCode_[0-9][0-9][0-9][0-9][03579]*.bam: No such file or directory
md5sum /path/to/IonCode_[0-9][0-9][0-9][0-9][03579]*.bam: No such file or directory

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting 10 digit number from txt files

Hi, Was wondering if you could give me an example of extracting a 10 digit number from 5 txt files using a regular expression (the number is always different ) and storing the numbers in variables Thanks C19 (9 Replies)
Discussion started by: c19h28O2
9 Replies

2. Shell Programming and Scripting

adding a 6 digit number retaining 0s on the left

i am new to shell scripting. i want to keep on increamenting a 6 digit number. For eg. 000000 + 1 = 000001 But instead of 000001 i get only 1. How do i do this ? Pls help. (8 Replies)
Discussion started by: kanchan_cp
8 Replies

3. Programming

generating 16 digit random number in C

Hi, How can we generate 16 digit random nos in C. (10 Replies)
Discussion started by: ajaysahoo
10 Replies

4. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

5. Programming

Find out 2^n+1 , where n is a 3 digit number

I have to write a c program which takes a 3 digit number n and calculates the value of (2^n)+1 and then determines the number is prime or not. I have tried to first calculate the value of 2^n and then adding one to it and then apply the logic of prime number. but the ultimate problem is that... (7 Replies)
Discussion started by: agrawal.prachi
7 Replies

6. UNIX for Dummies Questions & Answers

list all files containing 4 digit number using grep

how can i list all files in my home directory that have a 4 digit id number, the line number where the id is located and the id itself not printing the entire line? (5 Replies)
Discussion started by: hobiwhenuknowme
5 Replies

7. UNIX for Dummies Questions & Answers

How to Separate Odd and Even number from one data set?

Hi, If I want to separate data set to new file by odd and even number. If data set like this 1 ABC 235 hgf 2 DEF 326 kjk 3 XXX 133 kwd 4 YYY 188 fgh If I want separate by colum3 I want result like set 1 1 ABC 235 hgf 3 XXX 133 kwd put to new... (3 Replies)
Discussion started by: GeodusT
3 Replies

8. Shell Programming and Scripting

increment counter as suffix starting with the rightmost digit

Hi, I would like to add a suffix to a file name but maintain the suffix length to 5 digits. For eg, output > 1st_file.00001, 2nd_file.00002...10th_file.00010....100th_file.00100 Can anyone please advise me on how to go about it? Platform: SunOS mps201a 5.9 Generic_118558-39 sun4u... (7 Replies)
Discussion started by: danish0909
7 Replies

9. Shell Programming and Scripting

Regular expression for 6 digit number present in a line

Hello Team, i have a file test1.txt, in which i have to grep only the 6 digit number from it, Could you pls help in this. $cat test1.txt <description>R_XYZ_1.6 r370956</description> $ grep "\{6\}" test1.txt <description>R_XYZ_1.6 r370956</description> i need output as 370956. ... (3 Replies)
Discussion started by: chandana hs
3 Replies

10. Shell Programming and Scripting

How to compare specific digit in number?

Dear All, Lets say I have a number with following format: ####.12e-## now I want to compare place holder in position 1 and 2. How can I do that? Note: My number is stored in a variable say var. example: var=9999.12e-05 Thanks & Regards, linuxUser_ (6 Replies)
Discussion started by: linuxUser_
6 Replies
Bio::Index::Fastq(3pm)					User Contributed Perl Documentation				    Bio::Index::Fastq(3pm)

NAME
Bio::Index::Fastq - Interface for indexing (multiple) fastq files SYNOPSIS
# Complete code for making an index for several # fastq files use Bio::Index::Fastq; use strict; my $Index_File_Name = shift; my $inx = Bio::Index::Fastq->new( '-filename' => $Index_File_Name, '-write_flag' => 1); $inx->make_index(@ARGV); # Print out several sequences present in the index # in Fastq format use Bio::Index::Fastq; use strict; my $Index_File_Name = shift; my $inx = Bio::Index::Fastq->new('-filename' => $Index_File_Name); my $out = Bio::SeqIO->new('-format' => 'Fastq','-fh' => *STDOUT); foreach my $id (@ARGV) { my $seq = $inx->fetch($id); # Returns Bio::Seq::Quality object $out->write_seq($seq); } # or, alternatively my $id; my $seq = $inx->get_Seq_by_id($id); #identical to fetch DESCRIPTION
Inherits functions for managing dbm files from Bio::Index::Abstract.pm, and provides the basic funtionallity for indexing fastq files, and retrieving the sequence from them. Note: for best results 'use strict'. Bio::Index::Fastq supports the Bio::DB::BioSeqI interface, meaning it can be used as a Sequence database for other parts of bioperl FEED_BACK Mailing Lists User feedback is an integral part of the evolution of this and other Bioperl modules. Send your comments and suggestions preferably to one of the Bioperl mailing lists. 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 the bugs and their resolution. Bug reports can be submitted via the web: https://redmine.open-bio.org/projects/bioperl/ AUTHOR - Tony Cox Email - avc@sanger.ac.uk APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ _file_format Title : _file_format Function: The file format for this package, which is needed by the SeqIO system when reading the sequence. Returns : 'Fastq' _index_file Title : _index_file Usage : $index->_index_file( $file_name, $i ) Function: Specialist function to index FASTQ format files. Is provided with a filename and an integer by make_index in its SUPER class. Example : Returns : Args : id_parser Title : id_parser Usage : $index->id_parser( CODE ) Function: Stores or returns the code used by record_id to parse the ID for record from a string. Useful for (for instance) specifying a different parser for different flavours of FASTQ file. Returns &default_id_parser (see below) if not set. If you supply your own id_parser subroutine, then it should expect a fastq description line. An entry will be added to the index for each string in the list returned. Example : $index->id_parser( &my_id_parser ) Returns : ref to CODE if called without arguments Args : CODE default_id_parser Title : default_id_parser Usage : $id = default_id_parser( $header ) Function: The default Fastq ID parser for Fastq.pm Returns $1 from applying the regexp /^>s*(S+)/ to $header. Returns : ID string Args : a fastq header line string perl v5.14.2 2012-03-02 Bio::Index::Fastq(3pm)
All times are GMT -4. The time now is 09:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy