Sponsored Content
Top Forums Shell Programming and Scripting Extract length wise sequences from fastq file Post 302788269 by Yoda on Monday 1st of April 2013 11:55:55 AM
Old 04-01-2013
Code:
awk 'length($0) >=21 && length($0) <= 25' inputfile > outputfile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To extract data of a perticular interval (date-time wise)

I want a shell script which extract data from a log file which contains date and time-wise data and i need the data for a perticular interval of time...what can i do??? (3 Replies)
Discussion started by: abhishek27
3 Replies

2. UNIX for Dummies Questions & Answers

Convert a tab delimited/variable length file to fixed length file

Hi, all. I need to convert a file tab delimited/variable length file in AIX to a fixed lenght file delimited by spaces. This is the input file: 10200002<tab>US$ COM<tab>16/12/2008<tab>2,3775<tab>2,3783 19300978<tab>EURO<tab>16/12/2008<tab>3,28523<tab>3,28657 And this is the expected... (2 Replies)
Discussion started by: Everton_Silveir
2 Replies

3. Shell Programming and Scripting

Extract sequences based on the list

Hi, I have a file with more than 28000 records and it looks like below.. >mm10_refflat_ABCD range=chr1:1234567-2345678 tgtgcacactacacatgactagtacatgactagac....so on >mm10_refflat_BCD range=chr1:3234567-4545678... tgtgcacactacacatgactagtatgtgcacactacacatgactagta . . . . . so on ... (2 Replies)
Discussion started by: Diya123
2 Replies

4. Shell Programming and Scripting

Extract substring specif position and length from file line

Hi gurus, I am trying to figure out how to extract substring from file line (all lines in file), as specified position and specified legth. Example input (file lines) dhaskjdsa dsadhkjsa dhsakjdsad hsadkjh dsahjdksahdsad sahkjd sahdkjsahd sajkdh adhjsak I want to extract substring on... (5 Replies)
Discussion started by: ProsteJa
5 Replies

5. Shell Programming and Scripting

Extract sequences of bytes from binary for differents blocks

Hello to all, I would like to search sequences of bytes inside big binary file. The bin file contains blocks of information, each block begins is estructured as follow: 1- Each block begins with the hex 32 (1 byte) and ends with FF. After the FF of the last block, it follows 33. 2- Next... (59 Replies)
Discussion started by: Ophiuchus
59 Replies

6. Shell Programming and Scripting

Extract the part of sequences from a file

I have a text file, input.fasta contains some protein sequences. input.fasta is shown below. >P02649 MKVLWAALLVTFLAGCQAKVEQAVETEPEPELRQQTEWQSGQRWELALGRFWDYLRWVQT LSEQVQEELLSSQVTQELRALMDETMKELKAYKSELEEQLTPVAEETRARLSKELQAAQA RLGADMEDVCGRLVQYRGEVQAMLGQSTEELRVRLASHLRKLRKRLLRDADDLQKRLAVY... (8 Replies)
Discussion started by: rahim42
8 Replies

7. Shell Programming and Scripting

Extract sequences from a FASTA file based on another file

I have two files. File1 is shown below. >153L:B|PDBID|CHAIN|SEQUENCE RTDCYGNVNRIDTTGASCKTAKPEGLSYCGVSASKKIAERDLQAMDRYKTIIKKVGEKLCVEPAVIAGIISRESHAGKVL KNGWGDRGNGFGLMQVDKRSHKPQGTWNGEVHITQGTTILINFIKTIQKKFPSWTKDQQLKGGISAYNAGAGNVRSYARM DIGTTHDDYANDVVARAQYYKQHGY >16VP:A|PDBID|CHAIN|SEQUENCE... (7 Replies)
Discussion started by: nelsonfrans
7 Replies

8. Shell Programming and Scripting

Extract count of string in all files and display on date wise

Hi All, hope you all are doing well! I kindly ask you for shell scripting help, here is the description: I have huge number of files shown below on date wise, which contains different strings(numbers you can say) including 505001 and 602001. ... (14 Replies)
Discussion started by: VasuKukkapalli
14 Replies

9. Shell Programming and Scripting

Outputting sequences based on length with sed

I have this file: >ID1 AA >ID2 TTTTTT >ID-3 AAAAAAAAA >ID4 TTTTTTGGAGATCAGTAGCAGATGACAG-GGGGG-TGCACCCC Add I am trying to use this script to output sequences longer than 15 characters: sed -r '/^>/N;{/^.{,15}$/d}' The desire output would be this: >ID4... (8 Replies)
Discussion started by: Xterra
8 Replies

10. UNIX for Beginners Questions & Answers

How to count the length of fasta sequences?

I could calculate the length of entire fasta sequences by following command, awk '/^>/{if (l!="") print l; print; l=0; next}{l+=length($0)}END{print l}' unique.fasta But, I need to calculate the length of a particular fasta sequence specified/listed in another txt file. The results to to be... (14 Replies)
Discussion started by: dineshkumarsrk
14 Replies
Bio::Tools::Run::BWA(3pm)				User Contributed Perl Documentation				 Bio::Tools::Run::BWA(3pm)

NAME
Bio::Tools::Run::BWA - Run wrapper for the BWA short-read assembler *BETA* SYNOPSIS
# create an assembly # run BWA commands separately DESCRIPTION
This module provides a wrapper interface for Heng Li's reference-directed short read assembly suite "bwa" (see http://bio-bwa.sourceforge.net/bwa.shtml <http://bio-bwa.sourceforge.net/bwa.shtml> for manuals and downloads). Manipulating the alignments requires "samtools" (<http://sourceforge.net/projects/samtools/>) and Lincoln Stein's package "Bio-SamTools" (<http://search.cpan.org/perldoc?Bio::DB::Sam>). There are two modes of action. o Easy assembly The first is a simple pipeline through the "maq" commands, taking your read data in and squirting out an assembly object of type Bio::Assembly::IO::maq. The pipeline is based on the one performed by "maq.pl easyrun": Action maq commands ------ ------------ data conversion to fasta2bfa, fastq2bfq maq binary formats map sequence reads map to reference seq assemble, creating assemble consensus convert map & cns mapview, cns2fq files to plaintext (for B:A:IO:maq) Command-line options can be directed to the "map", "assemble", and "cns2fq" steps. See "OPTIONS" below. o BWA command mode The second mode is direct access to "bwa" commands. To run a "bwa" command, construct a run factory, specifying the desired command using the "-command" argument in the factory constructor, along with options specific to that command (see "OPTIONS"): $bwafac = Bio::Tools::Run::BWA->new( -command => 'fasta2bfa' ); To execute, use the "run_bwa" methods. Input and output files are specified in the arguments of "run_bwa" (see "FILES"): $bwafac->run_bwa( -fas => "myref.fas", -bfa => "myref.bfa" ); OPTIONS
"bwa" is complex, with many subprograms (commands) and command-line options and file specs for each. This module attempts to provide commands and options comprehensively. You can browse the choices like so: $bwafac = Bio::Tools::Run::BWA->new( -command => 'aln' ); # all maq commands @all_commands = $bwafac->available_parameters('commands'); @all_commands = $bwafac->available_commands; # alias # just for aln @aln_params = $bwafac->available_parameters('params'); @aln_switches = $bwafac->available_parameters('switches'); @aln_all_options = $bwafac->available_parameters(); Reasonably mnemonic names have been assigned to the single-letter command line options. These are the names returned by "available_parameters", and can be used in the factory constructor like typical BioPerl named parameters. See http://bio-bwa.sourceforge.net/bwa.shtml <http://bio-bwa.sourceforge.net/bwa.shtml> for the gory details. FILES
When a command requires filenames, these are provided to the "run_bwa" method, not the constructor ("new()"). To see the set of files required by a command, use "available_parameters('filespec')" or the alias "filespec()": $bwafac = Bio::Tools::Run::BWA->new( -command => 'aln' ); @filespec = $bwafac->filespec; This example returns the following array: fas faq >sai This indicates that the FASTA database (faq) and the FASTQ reads (faq) MUST be specified, and the STDOUT of this program (SA coordinates) MAY be slurped into a file specified in the "run_bwa" argument list: $bwafac->run_bwa( -fas => 'my.db.fas', -faq => 'reads.faq', -sai => 'out.sai' ); If files are not specified per the filespec, text sent to STDOUT and STDERR is saved and is accessible with "$bwafac-"stdout()> and "$bwafac-"stderr()>. 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: http://redmine.open-bio.org/projects/bioperl/ AUTHOR - Mark A. Jensen Email maj -at- fortinbras -dot- us APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new() Title : new Usage : my $obj = new Bio::Tools::Run::BWA(); Function: Builds a new Bio::Tools::Run::BWA object Returns : an instance of Bio::Tools::Run::BWA Args : run Title : run Usage : $assembly = $bwafac->run( @args ); Function: Run the bwa assembly pipeline. Returns : Assembly results (file, IO object or Assembly object) Args : - fastq file containing single-end reads - fasta file containing the reference sequence - [optional] fastq file containing paired-end reads run_bwa() Title : run_bwa Usage : $obj->run_bwa( @file_args ) Function: Run a bwa command as specified during object contruction Returns : Args : a specification of the files to operate on: stdout() Title : stdout Usage : $fac->stdout() Function: store the output from STDOUT for the run, if no file specified in run_maq() Example : Returns : scalar string Args : on set, new value (a scalar or undef, optional) stderr() Title : stderr Usage : $fac->stderr() Function: store the output from STDERR for the run, if no file is specified in run_maq() Example : Returns : scalar string Args : on set, new value (a scalar or undef, optional) Bio::Tools::Run::AssemblerBase overrides _check_sequence_input() No-op. _check_optional_quality_input() No-op. _prepare_input_sequences Convert input fastq and fasta to maq format. _collate_subcmd_args() Title : _collate_subcmd_args Usage : $args_hash = $self->_collate_subcmd_args Function: collate parameters and switches into command-specific arg lists for passing to new() Returns : hash of named argument lists Args : [optional] composite cmd prefix (scalar string) [default is 'run'] _run() Title : _run Usage : $factory->_run() Function: Run a bwa assembly pipeline Returns : a text-formatted sam alignment Args : - single end read file in maq bfq format - reference seq file in maq bfa format - [optional] paired end read file in maq bfq format available_parameters() Title : available_parameters Usage : @cmds = $fac->available_commands('commands'); Function: Use to browse available commands, params, or switches Returns : array of scalar strings Args : 'commands' : all bwa commands 'params' : parameters for this object's command 'switches' : boolean switches for this object's command 'filespec' : the filename spec for this object's command 4Geeks : Overrides Bio::ParameterBaseI via Bio::Tools::Run::AssemblerBase perl v5.12.3 2011-06-18 Bio::Tools::Run::BWA(3pm)
All times are GMT -4. The time now is 08:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy