Sponsored Content
Full Discussion: Easy seq Question
Top Forums Shell Programming and Scripting Easy seq Question Post 303025109 by Corona688 on Wednesday 24th of October 2018 01:35:32 PM
Old 10-24-2018
After much experimenting with the -f feature I finally figured out how to trick it. It needs %.0f to make it print integers, followed by whatever string you want.

Code:
seq -f '%.0f -' 1 20

I suspect it's not really meant for that and might not work the same or reliably on other systems.
These 2 Users Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Easy question

Hi, Simple question. How do I convert a unix text file to a dos text file? Thanks Helen (4 Replies)
Discussion started by: Bab00shka
4 Replies

2. UNIX for Dummies Questions & Answers

easy question

I know the Sun Solaries versions are ( 2.3 , 2.4 , 2.5 ... 7 , 8 ) . But some times I see sun os v5.x what does it mean ?? also what is the last new machine for sun and what are its details specifications . Thanks (3 Replies)
Discussion started by: tamemi
3 Replies

3. UNIX for Dummies Questions & Answers

Another easy question

Hello Again, Ok guys. Thanks again for your help last time but I am in need of your experience again. I wrote this script: #!/bin/sh # List either files or directories in individual accounts # using 1, 2 or 3 with invalid case $1 in echo select 1 to see the FILES in your... (3 Replies)
Discussion started by: catbad
3 Replies

4. Shell Programming and Scripting

A easy question.

this is the simple question, please help me! the question is: how to send exactly 50 ICMP Echo request packets with 500 bytes of payload to 202.139.129.221? I tried to use ping -F 500 202.139.129.221, but it didn't work. Thanks! (6 Replies)
Discussion started by: kikikaka
6 Replies

5. UNIX for Dummies Questions & Answers

easy unix question

I am trying to check through all of a certain type of file in all main directories, and find the top 10 that are taking up the most space. How can I do that? I was thinking like du *.file | sort -n | head (1 Reply)
Discussion started by: wallacer
1 Replies

6. Shell Programming and Scripting

Easy AWK question

Ive got some output in a file that looks exactly like this: 1 ----------- 1542 1 record(s) selected. How do I just extract that 1542 and drop it into another file or (preferrably) a variable (using a ksh script) (9 Replies)
Discussion started by: rdudejr
9 Replies

7. Shell Programming and Scripting

Hopefully an Easy Question

I have a file name in this format ABC_WIRE_TRANS_YYYYMMDD_00.DAT I need to cut out the _00 out of the file name everytime. It could be _00, _01,_02, etc .... How do I cut it out to look as follows? ABC_WIRE_TRANS_YYYYMMDD.DAT (6 Replies)
Discussion started by: lesstjm
6 Replies

8. UNIX for Dummies Questions & Answers

easy question

Hi everybody: Could anybody tell me if I have several files which each one it has this pattern name: name1.dat name2.dat name3.dat name4.dat name10.dat name11.dat name30.dat If I would like create one like: name_total.dat If I do: paste name*.dat > name_total.dat (15 Replies)
Discussion started by: tonet
15 Replies

9. Shell Programming and Scripting

Easy cat question

I am having problems getting a list of filenames that I want from a directory. example: I have 3 files - filename.xxx.20110505.123030 filename.yyy.20110505.123030 filename.zzz.20110505.123030 There may be multiple xxx,... (3 Replies)
Discussion started by: Drenhead
3 Replies

10. UNIX for Dummies Questions & Answers

Easy Grep Question

This seems like an easy question, but I can't find an answer already posted. I want a command to return all of the lines in a file containing exactly a string I tried grep -x "372701" x.txt but this did not return anything I am just trying to search a file for lines which contain... (4 Replies)
Discussion started by: jgrosecl
4 Replies
Bio::FeatureIO(3pm)					User Contributed Perl Documentation				       Bio::FeatureIO(3pm)

NAME
Bio::FeatureIO - Handler for FeatureIO SYNOPSIS
use Bio::FeatureIO; #read from a file $in = Bio::FeatureIO->new(-file => "my.gff" , -format => 'GFF'); #read from a filehandle $in = Bio::FeatureIO->new(-fh => *GFF , -format => 'GFF'); #read features already attached to a sequence my $feat = Bio::FeatureIO->new(-seq => $seq , -format => 'features'); #read new features for existing sequence my $seq = Bio::FeatureIO->new(-seq => $seq , -format => 'Das'); #write out features $out = Bio::FeatureIO->new(-file => ">outputfilename" , -format => 'GFF' , -version => 3); while ( my $feature = $in->next_feature() ) { $out->write_feature($feature); } DESCRIPTION
NOTE: This is a highly experimental I/O iterator subsystem for genomic sequence features. It is not complete, and is now undergoing a significant refactoring in a separate branch of BioPerl to address specific issues regarding the current implementation. Use at your own risk. Bio::FeatureIO is a handler module for the formats in the FeatureIO set (eg, Bio::FeatureIO::GFF). The Bio::FeatureIO system can be thought of like biological file handles. They are attached to filehandles with smart formatting rules (eg, GFF format, or BED format) and can either read or write feature objects (Bio::SeqFeature objects, or more correctly, Bio::FeatureHolderI implementing objects, of which Bio::SeqFeature is one such object). If you want to know what to do with a Bio::SeqFeatureI object, read Bio::SeqFeatureI. The idea is that you request a stream object for a particular format. All the stream objects have a notion of an internal file that is read from or written to. A particular FeatureIO object instance is configured for either input or output. A specific example of a stream object is the Bio::FeatureIO::gff object. Each stream object has functions: $stream->next_feature(); $stream->write_feature($feature); SUPPORTED FORMATS
name module ----------------------------------- BED bed.pm GFF gff.pm GTF gtf.pm InterPro (IPRScan 4.0) interpro.pm PTT (NCBI protein table) ptt.pm CONSTRUCTORS
Bio::FeatureIO->new() $featureIO = Bio::FeatureIO->new(-file => 'filename', -format=>$format); $featureIO = Bio::FeatureIO->new(-fh => *FILEHANDLE, -format=>$format); $featureIO = Bio::FeatureIO->new(-seq => $seq, -format=>$format); The new() class method constructs a new Bio::FeatureIO object. The returned object can be used to retrieve or print Seq objects. new() accepts the following parameters: -file A file path to be opened for reading or writing. The usual Perl conventions apply: 'file' # open file for reading '>file' # open file for writing '>>file' # open file for appending '+<file' # open file read/write 'command |' # open a pipe from the command '| command' # open a pipe to the command -fh You may provide new() with a previously-opened filehandle. For example, to read from STDIN: $featio = Bio::FeatureIO->new(-fh => *STDIN); Note that you must pass filehandles as references to globs. If neither a filehandle nor a filename is specified, then the module will read from the @ARGV array or STDIN, using the familiar <> semantics. A string filehandle is handy if you want to modify the output in the memory, before printing it out. The following program reads in EMBL formatted entries from a file and prints them out in fasta format with some HTML tags: use Bio::FeatureIO; use IO::String; my $in = Bio::FeatureIO->new('-file' => "my.gff" , '-format' => 'EMBL'); while ( my $f = $in->next_feature() ) { # the output handle is reset for every file my $stringio = IO::String->new($string); my $out = Bio::FeatureIO->new('-fh' => $stringio, '-format' => 'gtf'); # output goes into $string $out->write_feature($f); # modify $string $string =~ s|(>)(w+)|$1<font color="Red">$2</font>|g; # print into STDOUT print $string; } -format Specify the format of the file. See above for list of supported formats -flush By default, all files (or filehandles) opened for writing sequences will be flushed after each write_seq() (making the file immediately usable). If you don't need this facility and would like to marginally improve the efficiency of writing multiple sequences to the same file (or filehandle), pass the -flush option '0' or any other value that evaluates as defined but false: my $f1 = Bio::FeatureIO->new -file => "<a.f1", -format => "f1"; my $f2 = Bio::FeatureIO->new -file => ">a.f2", -format => "f2", -flush => 0; # go as fast as we can! while($feature = $f1->next_feature) { $f2->write_feature($feature) } Bio::FeatureIO->newFh() $fh = Bio::FeatureIO->newFh(-fh => *FILEHANDLE, -format=>$format); $fh = Bio::FeatureIO->newFh(-format => $format); # etc. This constructor behaves like new(), but returns a tied filehandle rather than a Bio::FeatureIO object. You can read sequences from this object using the familiar <> operator, and write to it using print(). The usual array and $_ semantics work. For example, you can read all sequence objects into an array like this: @features = <$fh>; Other operations, such as read(), sysread(), write(), close(), and printf() are not supported. OBJECT METHODS
See below for more detailed summaries. The main methods are: $feature = $featureIO->next_feature() Fetch the next feature from the stream. $featureIO->write_feature($feature [,$another_feature,...]) Write the specified feature(s) to the stream. TIEHANDLE(), READLINE(), PRINT() These provide the tie interface. See perltie for more details. 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 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 - Allen Day Email allenday@ucla.edu APPENDIX
The rest of the documentation details each of the object methods. Internal methods are usually preceded with a _ new Title : new Usage : $stream = Bio::FeatureIO->new(-file => $filename, -format => 'Format') Function: Returns a new feature stream Returns : A Bio::FeatureIO stream initialised with the appropriate format Args : Named parameters: -file => $filename -fh => filehandle to attach to -format => format newFh Title : newFh Usage : $fh = Bio::FeatureIO->newFh(-file=>$filename,-format=>'Format') Function: does a new() followed by an fh() Example : $fh = Bio::FeatureIO->newFh(-file=>$filename,-format=>'Format') $feature = <$fh>; # read a feature object print $fh $feature; # write a feature object Returns : filehandle tied to the Bio::FeatureIO::Fh class Args : See Bio::FeatureIO::Fh fh Title : fh Usage : $obj->fh Function: Example : $fh = $obj->fh; # make a tied filehandle $feature = <$fh>; # read a feature object print $fh $feature; # write a feature object Returns : filehandle tied to Bio::FeatureIO class Args : none next_feature Title : next_feature Usage : $feature = stream->next_feature Function: Reads the next feature object from the stream and returns it. Certain driver modules may encounter entries in the stream that are either misformatted or that use syntax not yet understood by the driver. If such an incident is recoverable, e.g., by dismissing a feature of a feature table or some other non-mandatory part of an entry, the driver will issue a warning. In the case of a non-recoverable situation an exception will be thrown. Do not assume that you can resume parsing the same stream after catching the exception. Note that you can always turn recoverable errors into exceptions by calling $stream->verbose(2). Returns : a Bio::SeqFeatureI feature object Args : none See Bio::Root::RootI, Bio::SeqFeatureI write_feature Title : write_feature Usage : $stream->write_feature($feature) Function: writes the $feature object into the stream Returns : 1 for success and 0 for error Args : Bio::SeqFeature object _load_format_module Title : _load_format_module Usage : *INTERNAL FeatureIO stuff* Function: Loads up (like use) a module at run time on demand Example : Returns : Args : seq Title : seq Usage : $obj->seq() OR $obj->seq($newSeq) Example : Returns : Bio::SeqI object Args : newSeq (optional) _filehandle Title : _filehandle Usage : $obj->_filehandle($newval) Function: This method is deprecated. Call _fh() instead. Example : Returns : value of _filehandle Args : newvalue (optional) _guess_format Title : _guess_format Usage : $obj->_guess_format($filename) Function: guess format based on file suffix Example : Returns : guessed format of filename (lower case) Args : Notes : See "SUPPORTED FORMATS" perl v5.14.2 2012-03-02 Bio::FeatureIO(3pm)
All times are GMT -4. The time now is 12:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy