Considerable trouble with for loop in combination with awk
I have the text file where each line has the format:
chr10 101418889 101418904 0.816327
Right now the interval between column 2 and 3 is 15. I only want the two consecutive positions starting at position 1, write it to a file, then move up one position write to file etc. So that:
Hi there,
I have 3 files and i want to take different fields from each file and combine them in one. I would like to ask if somebody tell me how can I refer to each field of the different files to write an awk command.
I mean can I do sth like
awk '........... print $1.file1 $3.file2}'... (1 Reply)
I have seen this done before - and maybe there is a better way too.
I want to be abe to use a for loop (or other better method) to loop through the database instance names that are part of the script - not an external file where a read might be ok.
Here is what I have and I know won't work -... (5 Replies)
Can anyone tell me what's wrong with my code here? I'm experiencing weird behavior...
I am using 'j' to go down a list filenames saved in a .txt file and prompting the user whether or not she would like to delete each one. This works all well and fine the first run through, but then instead of... (2 Replies)
i don't get what's wrong here. i'm writing a shell script that takes 1 argument (a number) from the command-line, but it's throwing an error:
Syntax error: Bad for loop variable
doesn't make much sense
for (( i = 1; i = ${1}; i++ )) # error points to this line everytime
do
echo... (9 Replies)
I have been reading for a few hours trying to educate myself enough to accomplish this task, so please know I have performed some research. Unfortunately, I am not a *NIX scripting expert, or a coder. I come from a network background instead.
SO, here is my desired outcome. I have some Cisco... (5 Replies)
When I run the following command in the shell it works fine. It prints a city name and then a path for a file.
~$ for i in `awk -F':' '{print $0}' /home/knoppix/Desktop/data/subs | grep -m 1 $ city | sed "s/:/ /"`
>do
>echo $i
>done
Now, when I place it in this shell script (sh) it prints... (6 Replies)
HI there,
I am trying to count manually what this code does but I am stuck and I don't learly see the result. The code works and it compiles and runs but I just don't follow the value of var.
#include<stdio.h>
#include<stdlib.h>
#include<sys/types.h>
#include<unistd.h>
#include<wait.h>... (2 Replies)
Good evening all I have what might be a simple problem to solve but I do not know how to solve it myself. I am writing a bash script and my code looks something like this:
mp3=`ls | grep \.mp3`
for f in $mp3
do
echo $f
done
Basically what I want to do is look through the current... (4 Replies)
Hello,
i wondering if anybody can help me with the following:
doing a search for the words "Sample ID:" in a file called test.txt
and I need to have the string after this (Postmatch)
Then I want that the string is used to rename an other file called test.pdf into .... the string.pdf
I... (8 Replies)
Discussion started by: pcdok
8 Replies
LEARN ABOUT DEBIAN
bio::featureio::bed
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)