Mercurial > repos > nml > fasta2bed
comparison fasta_to_bed.pl @ 0:1b3c339fd390 draft default tip
planemo upload for repository https://github.com/phac-nml/galaxy_tools commit a0204b99a722240fe9b03b78a0786b30aa8ecc96
author | nml |
---|---|
date | Wed, 11 Oct 2017 11:46:25 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1b3c339fd390 |
---|---|
1 #!/usr/bin/env perl | |
2 use strict; | |
3 use warnings; | |
4 use Bio::SeqIO; | |
5 use Bio::Seq; | |
6 use Getopt::Long; | |
7 | |
8 my ($fasta_file, $out); | |
9 | |
10 GetOptions( | |
11 "i|input=s" => \$fasta_file, #contigs fasta file | |
12 "o|output=s" => \$out | |
13 ); | |
14 | |
15 my $seqio_object= Bio::SeqIO->new (-format =>'fasta', -file=>$fasta_file); | |
16 open(my $out_fh, ">", $out) || die "Could write to file '$out'\n"; | |
17 | |
18 while (my $seq_object = $seqio_object->next_seq()) { | |
19 my $seq_id = $seq_object->display_id(); | |
20 my $length = $seq_object->length(); | |
21 print $out_fh $seq_id . "\t" . "1" . "\t" . $length . "\t" . $seq_id . "\n"; | |
22 | |
23 } | |
24 | |
25 |