Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Redirecting stdout inside a loop Post 302912733 by hmortens on Monday 11th of August 2014 03:00:15 PM
Old 08-11-2014
I am not familiar with VAR. But the stout.miRNA.bash.$date_formatted is where /Processed reads/ and /Trimmed reads/ comes from. It was buried in my previous posting. The first few lines of the file for the first sample are:
Code:
**testing** /illumina/runs/Runs/140513_H207_0249_AD2B9LACXX/Unaligned_Lane1/Project_DefaultProject/Sample_GRC270_DEHP2_67C/GRC270_DEHP2_67C_CGATGT_L001_R1_001.fastq.gz
/illumina/runs/Runs/140513_H207_0249_AD2B9LACXX/Unaligned_Lane1/Project_DefaultProject/Sample_GRC270_DEHP2_67C
GRC270_DEHP2_67C
cutadapt version 1.2.1
Command line parameters: -a AGATCGGAAGAGCACACGTCT -o /illumina/runs/Runs/140513_H207_0249_AD2B9LACXX/Unaligned_Lane1/Project_DefaultProject/Sample_GRC270_DEHP2_67C/GRC270_DEHP2_67C_cutadapt_AdapterRemoved.fastq.gz /illumina/runs/Runs/140513_H207_0249_AD2B9LACXX/Unaligned_Lane1/Project_DefaultProject/Sample_GRC270_DEHP2_67C/GRC270_DEHP2_67C_CGATGT_L001_R1_001.fastq.gz
Maximum error rate: 10.00%
   No. of adapters: 1
   Processed reads:      2139267
   Processed bases:    109102617 bp (109.1 Mbp)
     Trimmed reads:      2075206 (97.0%)
     Trimmed bases:     53680380 bp (53.7 Mbp) (49.20% of total)
   Too short reads:            0 (0.0% of processed reads)
    Too long reads:            0 (0.0% of processed reads)
        Total time:    155.78 s
     Time per read:      0.07 ms

=== Adapter 1 ===

Adapter 'AGATCGGAAGAGCACACGTCT', length 21, was trimmed 2075206 times.

No. of allowed errors:
0-9 bp: 0; 10-19 bp: 1; 20-21 bp: 2

Lengths of removed sequences
length	count	expected	max. errors
3	13563	33426.0	0
4	13593	8356.5	0
5	19992	2089.1	0
6	143974	522.3	0
7	48435	130.6	0
8	22001	32.6	0

So, you can see I only need grab a few lines using identifiers, it is just that it needs to iterate so that we get context of sample 1, sample 2, etc. and concatenated with summary.txt for each sample.
Thank you! for you help:-)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

redirecting STDOUT & STDERR

In bash, I need to send the STDOUT and STDERR from a command to one file, and then just STDERR to another file. Doing one or the other using redirects is easy, but trying to do both at once is a bit tricky. Anyone have any ideas? (9 Replies)
Discussion started by: jshinaman
9 Replies

2. Shell Programming and Scripting

implicitly redirecting stdout to a file

Is there a way to redirect all stdout to a file implicitly - like defining stdout=/home/me/process.log - so that all "echo" commands in several scripts/subscripts are written to that file; instead of having to edit all scripts to redirect the "echo" (e.g. echo 'This is a test ' >>... (1 Reply)
Discussion started by: ALTRUNVRSOFLN
1 Replies

3. Shell Programming and Scripting

Redirecting part of output to stdout

Hi, I am trying to execute a command like this: find ./ -name "*.gz" -exec sh -c 'zcat {} | awk -f parse.awk' \; >> output If I want to print the filename, i generally use the -print argument to the find command but when I am redirecting the output to a file, how can I print just the... (2 Replies)
Discussion started by: Legend986
2 Replies

4. UNIX for Dummies Questions & Answers

Redirecting several outputs to /dev/stdout

I have an executable that, depending on its input, outputs to either one file or several. It usually prints nothing on screen. The usual way to call this program is to specify an input and output filenames, like this: ./executable.exe -i inputfile -o outputfileIt will then try to use the output... (1 Reply)
Discussion started by: aplaydoc
1 Replies

5. Shell Programming and Scripting

redirecting to stdout in betwen command

can anyone help me in making singleline command for Capital Letters are folders ,small letter are files X,Y,Z are subfolders of A as shown below A - X,Y,Z Folder X has three files a.txt,b.txt,c.txt similarly Y,Z. as shown below X- a.txt,b.txt,c.txt Y- a.txt,b.txt,c.txt Z-... (4 Replies)
Discussion started by: phoenix_nebula
4 Replies

6. Shell Programming and Scripting

Redirecting stdout to variable while printing it

Hi everybody, I am trying to do the thing you see in the title, and I can't simply do a=$(svn up) echo $a because the program (svn) gives output on lots of lines and in the variable the output is stored on only one line (resulting in a horribly formatted text). Any tips? Thanks,... (2 Replies)
Discussion started by: ocirne94
2 Replies

7. Shell Programming and Scripting

Redirecting stdout on background task

Hello, I have a script (videostream.sh) which invokes the GStreamer command-line tool gst-launch with all the correct command line parameters. When I invoke this program, I add the '&' character at the end to make it a background task, so that my script can complete and exit, i.e. gst-launch... (1 Reply)
Discussion started by: salukibob
1 Replies

8. Shell Programming and Scripting

Redirecting stdout problem

I have a simple bash script that prints sth every 5 seconds. What I do is the following. I redirect the output of the script to a file, tail the file and see that it works and then from another console I delete the file where the output is redirected to. Even though I have deleted the file, the... (2 Replies)
Discussion started by: igurov
2 Replies

9. Shell Programming and Scripting

Redirecting stdout continously to a file

I have a C program that continously outputs info to stdout. The problem is that I am redirecting the stdout and stderr to a file and stdout is written at the end of the problem rather than continously to the file. This could be a problem if for example the program is killed and the stdout output is... (3 Replies)
Discussion started by: igurov
3 Replies

10. Shell Programming and Scripting

Redirecting stdion, stdout within an AT command

Hello, I'm strugling with some redirecting and all help is apreciated. The following program is working as expected, but the result of the AT command doesn't go to any file. Thanks in advance for the help. #!/bin/bash modem=/dev/ttyUSB1 file=/root/imsi.txt # print error to stderr and exit... (4 Replies)
Discussion started by: cleitao
4 Replies
Bio::Tools::Run::Maq(3pm)				User Contributed Perl Documentation				 Bio::Tools::Run::Maq(3pm)

NAME
Bio::Tools::Run::Maq - Run wrapper for the Maq short-read assembler *BETA* SYNOPSIS
# create an assembly $maq_fac = Bio::Tools::Run::Maq->new(); $maq_assy = $maq_fac->run( 'reads.fastq', 'refseq.fas' ); # if IO::Uncompress::Gunzip is available... $maq_assy = $maq_fac->run( 'reads.fastq.gz', 'refseq.gz'); # paired-end $maq_assy = $maq_fac->run( 'reads.fastq', 'refseq.fas', 'paired-reads.fastq'); # be more strict $maq_fac->set_parameters( -c2q_min_map_quality => 60 ); $maq_assy = $maq_fac->run( 'reads.fastq', 'refseq.fas', 'paired-reads.fastq'); # run maq commands separately $maq_fac = Bio::Tools::Run::Maq->new( -command => 'pileup', -single_end_quality => 1 ); $maq_fac->run_maq( -bfa => 'refseq.bfa', -map => 'maq_assy.map', -txt => 'maq_assy.pup.txt' ); DESCRIPTION
This module provides a wrapper interface for Heng Li's reference-directed short read assembly suite "maq" (see http://maq.sourceforge.net/maq-man.shtml <http://maq.sourceforge.net/maq-man.shtml> for manuals and downloads). There are two modes of action. o EasyMaq 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 BigMaq The second mode is direct access to "maq" commands. To run a "maq" 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"): $maqfac->Bio::Tools::Run::Maq->new( -command => 'fasta2bfa' ); To execute, use the "run_maq" methods. Input and output files are specified in the arguments of "run_maq" (see "FILES"): $maqfac->run_maq( -fas => "myref.fas", -bfa => "myref.bfa" ); OPTIONS
"maq" 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: $maqfac = Bio::Tools::Run::Maq->new( -command => 'assemble' ); # all maq commands @all_commands = $maqfac->available_parameters('commands'); @all_commands = $maqfac->available_commands; # alias # just for assemble @assemble_params = $maqfac->available_parameters('params'); @assemble_switches = $maqfac->available_parameters('switches'); @assemble_all_options = $maqfac->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://maq.sourceforge.net/maq-manpage.shtml <http://maq.sourceforge.net/maq-manpage.shtml> for the gory details. FILES
When a command requires filenames, these are provided to the "run_maq" method, not the constructor ("new()"). To see the set of files required by a command, use "available_parameters('filespec')" or the alias "filespec()": $maqfac = Bio::Tools::Run::Maq->new( -command => 'map' ); @filespec = $maqfac->filespec; This example returns the following array: map bfa bfq1 #bfq2 2>#log This indicates that map ("maq" binary mapfile), bfa ("maq" binary fasta), and bfq ("maq" binary fastq) files MUST be specified, another bfq file MAY be specified, and a log file receiving STDERR also MAY be specified. Use these in the "run_maq" call like so: $maqfac->run_maq( -map => 'my.map', -bfa => 'myrefseq.bfa', -bfq1 => 'reads1.bfq', -bfq2 => 'reads2.bfq' ); Here, the "log" parameter was unspecified. Therefore, the object will store the programs STDERR output for you in the "stderr()" attribute: handle_map_warning($maqfac) if ($maqfac->stderr =~ /warning/); STDOUT for a run is also saved, in "stdout()", unless a file is specified to slurp it according to the filespec. "maq" STDOUT usually contains useful information on the run. 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::Maq(); Function: Builds a new Bio::Tools::Run::Maq object Returns : an instance of Bio::Tools::Run::Maq Args : run Title : run Usage : $assembly = $maq_assembler->run($read1_fastq_file, $refseq_fasta_file, $read2_fastq_file); Function: Run the maq 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 Note : gzipped inputs are allowed if IO::Uncompress::Gunzip is available run_maq() Title : run_maq Usage : $obj->run_maq( @file_args ) Function: Run a maq 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 maq assembly pipeline Returns : depends on call (An assembly file) 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 maq 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::Maq(3pm)
All times are GMT -4. The time now is 07:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy