Thanks dnewkirk
I always ignore the dates. A question with an answer many months after the OP is still likely to be valuable for someone out there.
Seqanswers Leaderboard Ad
Collapse
Announcement
Collapse
No announcement yet.
X
-
I had posted per the original question without noticing the dates . Either or works, but it may help someone who isn't as familiar with Perl on how to convert between file formats.
Leave a comment:
-
Thanks dnewkirk, could you tell us what would be the advantage to using your perl script would be over an awk command? I'm not criticizing, just wondering. I use an awk command in a shell script to convert.
Leave a comment:
-
Code:#!/usr/bin/perl use strict; use warnings; # get file names from the command line my ($input, $output) = @ARGV; # exceptions and usage if (!defined $input or !defined $output) { die "Usage: bedFromBowtie.pl <input> <output>\n"; } # open the input/output file open my $out, ">", "$output" or die "Cannot open $output: $!\n"; open my $in, "<", "$input" or die "Cannot open $input: $!\n"; while ( <$in> ) { chomp; my (undef, $strand, $chr, $start, $sequence) = split "\t"; # assumes standard bowtie output my @sequence = split '', $sequence; # extra work, but allows for variable-length sequences my $length = @sequence; my $end; if ($strand eq '+') { $end = $start + $length - 1; } elsif ($strand eq '-') { $end = $start; $start = $end - $length + 1; } else { die "We have a formatting problem: strand is set to $strand\n"; } print $out "$chr\t$start\t$end\tU0\t0\t$strand\n"; } print "Done!\n"; close $in; close $out; exit;
Leave a comment:
-
Originally posted by ysccseqanswers View PostHi,
what is H=111 $H,$2 doing in your command?
Thanks
$2 is the 6th column - the strand the read maps to.
If you wanted a random score for column 5 you could use this in the awk command instead:
"...$1,int(rand()*1000),$2}..."
Leave a comment:
-
Originally posted by arun View Postawk 'BEGIN {FS= "\t"; OFS="\t"} {print $3, $4, $4+length($5)-1, $1,
H=111 $H, $2}' Bowtie_output > Bowtie_output.BED
This is a shell command, give this command in "$" prompt, it will convert your input file (Bowtie_output) file to BED format (Bowtie_output.BED)
what is H=111 $H,$2 doing in your command?
Thanks
Leave a comment:
-
awk 'BEGIN {FS= "\t"; OFS="\t"} {print $3, $4, $4+length($5)-1, $1,
H=111 $H, $2}' Bowtie_output > Bowtie_output.BED
This is a shell command, give this command in "$" prompt, it will convert your input file (Bowtie_output) file to BED format (Bowtie_output.BED)
Leave a comment:
-
bowtie to BED format
awk 'BEGIN {FS= "\t"; OFS="\t"} {print $3, $4, $4+length($5)-1, $1,
H=111 $H, $2}' Bowtie_output > Bowtie_output.BED
This is a shell command, give this command in "$" prompt, it will convert your input file (Bowtie_output) file to BED format (Bowtie_output.BED)
Last edited by arun; 12-23-2010, 01:16 AM.
Leave a comment:
-
Hi polsum,
Do you know any Perl ? I have a perl script that will convert bowtie .map file to a .bed file, but you may have to know a little perl to work with it.
Leave a comment:
-
Originally posted by polsum View PostHi - Can any one please suggest a method to convert Bowtie output to BED format? Is there a bioperl script or any software for that?
thanks in advance.
Leave a comment:
-
Bowtie output to BED format
Hi - Can any one please suggest a method to convert Bowtie output to BED format? Is there a bioperl script or any software for that?
thanks in advance.Tags: None
Latest Articles
Collapse
-
by seqadmin
During the COVID-19 pandemic, scientists observed that while some individuals experienced severe illness when infected with SARS-CoV-2, others were barely affected. These disparities left researchers and clinicians wondering what causes the wide variations in response to viral infections and what role genetics plays.
Jean-Laurent Casanova, M.D., Ph.D., Professor at Rockefeller University, is a leading expert in this crossover between genetics and infectious...-
Channel: Articles
Yesterday, 10:59 AM -
-
by seqadmin
The first FDA-approved CRISPR-based therapy marked the transition of therapeutic gene editing from a dream to reality1. CRISPR technologies have streamlined gene editing, and CRISPR screens have become an important approach for identifying genes involved in disease processes2. This technique introduces targeted mutations across numerous genes, enabling large-scale identification of gene functions, interactions, and pathways3. Identifying the full range...-
Channel: Articles
08-27-2024, 04:44 AM -
ad_right_rmr
Collapse
News
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by seqadmin, 09-06-2024, 08:02 AM
|
0 responses
138 views
0 likes
|
Last Post
by seqadmin
09-06-2024, 08:02 AM
|
||
Started by seqadmin, 09-03-2024, 08:30 AM
|
0 responses
141 views
0 likes
|
Last Post
by seqadmin
09-03-2024, 08:30 AM
|
||
Started by seqadmin, 08-27-2024, 04:40 AM
|
0 responses
153 views
0 likes
|
Last Post
by seqadmin
08-27-2024, 04:40 AM
|
||
New Single-Molecule Sequencing Platform Introduces Advanced Features for High-Throughput Genomics
by seqadmin
Started by seqadmin, 08-22-2024, 05:00 AM
|
0 responses
396 views
0 likes
|
Last Post
by seqadmin
08-22-2024, 05:00 AM
|
Leave a comment: