annotate pseudogenome.pl @ 0:47b586ab4729 draft default tip

planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
author nml
date Fri, 06 Apr 2018 14:29:17 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
1 #!/usr/bin/env perl
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
2 use strict;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
3 use warnings;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
4 use autodie qw(:all);
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
5 use Bio::SeqIO;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
6 use Readonly;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
7 use File::Basename;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
8 use Getopt::Long;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
9 use Pod::Usage;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
10 Getopt::Long::Configure('bundling');
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
11
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
12 =head1 NAME
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
13
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
14 nml_pseudogenome.pl - To create a single pseudo genome out of multiple contigs provided in a single fasta file. Contig are combined in order of appearances in file
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
15
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
16 =head1 SYNOPSIS
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
17
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
18 nml_pseudogenome.pl -i F<file_name.fna> -n 100 -c X -o F<filename.fna>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
19
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
20 =head1 OPTIONS
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
21
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
22 =over
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
23
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
24 =item B<-i>, B<--input>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
25
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
26 Multiple fasta file
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
27
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
28 =item B<-n>, B<--number>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
29
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
30 Number of filler base pairs to be added, default : 10
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
31
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
32 =item B<-c>, B<--chars>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
33
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
34 Character to be used as the 'glue' between contigs, default : 'N'
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
35
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
36 =item B<--id>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
37
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
38 Name of fasta file to be used default: pseudogenome
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
39
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
40 =item B<-o>, B<--output>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
41
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
42 Output file name, default : Same as input
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
43
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
44 =item B<-s>, B<--stitch>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
45
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
46 Add the stitch pattern between contigs only
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
47
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
48 =item B<-h>, B<--help>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
49
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
50 Print this help
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
51
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
52 =item EXAMPLE
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
53
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
54 nml_pseudogenome.pl -i multiple_fasta.fna -n 100 -c X -o pseudo.fna
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
55
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
56 nml_pseudogenome.pl -i another_multiple.fna
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
57
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
58 =back
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
59
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
60 =head1 DESCRIPTION
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
61
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
62 To create a single pseudo genome out of multiple contigs provided in a single fasta file. Contig are combined in order of appearances in file.
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
63
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
64 =cut
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
65
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
66 # Nonsub perlcode
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
67
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
68 Readonly my $DEFAULT_NUM_CHAR => 10;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
69 Readonly my $stitch_pattern => 'NNNNNCACACACTTAATTAATTAAGTGTGTGNNNNN';
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
70 Readonly my $DEFAULT_CHAR => 'N';
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
71 my ( $input,$id, $number, $char, $output,$stitch, $help );
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
72
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
73 GetOptions(
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
74 'i|input=s' => \$input,
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
75 'n|number=s' => \$number,
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
76 'c|char=s' => \$char,
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
77 'o|output=s' => \$output,
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
78 'h|help' => \$help,
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
79 's|stitch' => \$stitch,
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
80 'id=s' => \$id
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
81 );
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
82 ($input,$id,$number,$char,$output) =check_inputs( $input, $number, $char,$output, $help,$stitch );
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
83
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
84
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
85
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
86 my $in = Bio::SeqIO->new(-file=>$input,-format=>'fasta');
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
87
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
88 my $sequence;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
89
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
90 #go thru every sequence and append to main sequence
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
91 while (my $seq = $in->next_seq()) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
92 if ($stitch) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
93 $sequence .= $seq->seq . $stitch_pattern;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
94 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
95 else {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
96 $sequence .= $seq->seq . ($char x $number );
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
97 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
98
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
99 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
100
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
101 my $main = Bio::Seq->new(-display_id=>$id,-seq=>$sequence);
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
102
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
103 my $out = Bio::SeqIO->new(-file => ">$output" ,-format=>'fasta');
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
104 $out->write_seq($main);
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
105
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
106 exit;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
107
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
108 =begin HTML
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
109
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
110 =head2 check_inputs
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
111
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
112 Title : check_inputs
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
113 Usage : check_inputs($fasta,$num,$filler,$out_to,$usage);
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
114 Function: check arguments provided by the user to see if they are usable and more or less correct
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
115 Returns : Return 1 if all is correct,otherwise 0
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
116 Args : $query: Query that we are looking for in the database. Could be accession number or locus_tag
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
117 $db: Name of database we are looking for using the query provided
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
118 $format: Ensure that format was given by user and is valid format
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
119 $usage: If true, return usage description
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
120 Throws : none
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
121
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
122 =cut
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
123
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
124 sub check_inputs {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
125 my ( $fasta, $num, $filler, $out_to, $usage,$use_stitch ) = @_;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
126
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
127 if ( $help || !( $fasta || $num || $filler || $out_to ) ) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
128 pod2usage();
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
129 exit;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
130 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
131
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
132 if ( !($fasta) || !( -e $fasta ) ) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
133 print STDERR "Error: Input file not given or does not exist\n";
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
134 pod2usage();
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
135 exit;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
136 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
137
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
138 if ($use_stitch) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
139 print "Using stitch pattern\n";
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
140
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
141 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
142 else {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
143 if ( !$num ) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
144 $num = $DEFAULT_NUM_CHAR;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
145 print STDERR "Number of character not given, using $num\n";
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
146 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
147 elsif ( !( $num =~ /^\d+$/xms ) ) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
148 print STDERR "Error: Number of character was not a number\n";
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
149 pod2usage();
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
150 exit;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
151 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
152
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
153 if ( !$filler ) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
154 $filler = $DEFAULT_CHAR;
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
155 print STDERR "No filler character given, using 'N'\n";
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
156 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
157
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
158 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
159
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
160 if ( !($out_to) ) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
161 $out_to = fileparse($fasta) . ".pseudogenome";
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
162 print
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
163 "Output file was not given. Result will be written to '$out_to'\n";
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
164 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
165 if ( ! $id) {
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
166 $id = 'pseudogenome';
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
167 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
168
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
169 return ( $fasta,$id, $num, $filler, $out_to );
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
170 }
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
171
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
172 =end HTML
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
173
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
174 =head1 SEE ALSO
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
175
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
176 No related files.
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
177
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
178 =head1 AUTHOR
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
179
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
180 Philip Mabon, <philip.mabon@canada.ca>
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
181
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
182 =head1 BUGS
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
183
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
184 None reported.
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
185
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
186 =head1 COPYRIGHT & LICENSE
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
187
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
188 Copyright (C) 2018 by Public Health Agency of Canada
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
189
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
190 This program is free software; you can redistribute it and/or modify
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
191 it under the same terms as Perl itself, either Perl version 5.8.2 or,
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
192 at your option, any later version of Perl 5 you may have available.
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
193
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
194 =head1 DEVELOPER PAGE
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
195
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
196 No developer documentation.
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
197
47b586ab4729 planemo upload commit 4fee4519135f7677cf50f721cf1ad7a7335ad66d-dirty
nml
parents:
diff changeset
198 =cut