annotate fasta_summary.pl @ 0:6544228ea290 default tip

Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
author konradpaszkiewicz
date Tue, 07 Jun 2011 16:24:46 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
1 #!/usr/bin/perl
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
2
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
3 #==============================================================================================
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
4
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
5 # Script to output statistsics and histograms for reads and contigs/isotigs
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
6
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
7
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
8 # Outputs include:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
9 # Mean, N50, StdDev or reads or contig lengths,
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
10 # Mean and Modal read or contig lengths.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
11 # Number of reads or contigs > 1 kb in length
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
12 # Summed contig length (by number of contigs, in sorted order)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
13 # Histogram of read or contig lengths,
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
14 # Graph of sums of read-lengths
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
15 # File of reads or contigs sorted by read or contig length
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
16 # Test for mono/di-nucelotide repeats
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
17 # Randomly selected reads or contigs
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
18
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
19
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
20 # Needs gnuplot installed to create the histograms:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
21 # On Fedora/Redhat linux: sudo yum install gnuplot
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
22 # On Ubuntu/Debian: sudo apt-get install gnuplot
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
23
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
24 # Uses a linux pipe to call gnu-plot directly, rather than as a separate shell script.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
25
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
26 # Original written by Sujai Kumar, 2008-09-05 University of Edinburgh
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
27 # Modified by Stephen: 29-Apr-2009:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
28 # Last changed by Stephen: 9-Aug-2010
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
29
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
30
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
31 # Usage: fasta_summary.pl -i infile.fasta -o process_reads -t read OR contig OR isotig (to use 'read' or 'contig' or 'isotig' in the output table & graphs. Isotig is for 'runAssembly -cdna ...' output file '454Isotigs.fna') [-r 1 to indicate count simple nucleotide repeats] [-n number of random reads to output] [-c cutoff_length] [-l 1 to indicate output the longest read] [-f (s or t or w) for spacer, tab or wiki format table output.]
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
32
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
33 # Note: The parameters above in the [] are optional.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
34
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
35 # eg: fasta_summary.pl -i myfile.fasta -o process_reads -t read
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
36 # Where:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
37 # -i reads or contigs as input, in fasta format.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
38 # -o output_dir (created if it doesn't exist)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
39 # -t read, contig or isotig
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
40
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
41 # Gives back
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
42 # - N50
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
43 # - num of contigs > 1 kb
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
44 # - num of contigs
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
45 # - Read or Contig Histogram and graphs.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
46 # - Summed contig length (by number of contigs, in sorted order)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
47
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
48 #==============================================================================================
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
49
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
50
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
51 use strict;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
52 use warnings;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
53 use Getopt::Long;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
54
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
55 my $infile;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
56 my $output_dir;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
57 my $type='read'; # Defaults to 'read' at present
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
58 my $repeats=1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
59 my $num_random_reads_to_output=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
60 my $cutoff_length=-1; # -1 means won't check this cutoff
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
61 my $longest_read=-1; # -1 mean's don't output the sequence for the longest read.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
62 my $doCommify=1; # Outputs statistics numbers in format: 9,999,999
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
63 my $format="t"; # "s"=spaces between columns, "t"=tabs between columns, "w"=wiki '||' and '|'.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
64 my $bucket1=0; # For optional exact length histogram distribution as asked for by JH.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
65
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
66 if ($#ARGV==-1) {die "
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
67 Usage:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
68
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
69 fasta_summary.pl -i infile.fasta -o output_dir -t ( read | contig | isotig ) [ -r 0 ] [ -n num_reads ] [ -c cutoff_length ] [ -l 1 ] [ -d 0 ] [ -f (w | t ) ] [ -bucket1 ]
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
70
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
71 where:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
72
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
73 -i or -infile infile.fasta : input fatsa file of raeds, contigs or isotigs,
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
74
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
75 -o or -output_dir output_directory : directory to put output stats and graphs into.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
76
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
77 -t or -type (read or contig or isotig) : for displaying the graph title, where type is 'read' or 'contig' or 'isotig'.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
78
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
79 -r or -repeats 0 or 1 : 1=count number of reads that contain over 70% simple mono-nucleotide and di-nucleotide repeat bases; 0=don't count.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
80
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
81 -n or -number num_reads : For outputting specified number of randomly selected reads or contigs.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
82
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
83 -c or -cutoff cutoff_length : Give a number of reads to do extra analysis (calculating again the number of reads and number of bases in reads above this length)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
84
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
85 -l or -longest 0 or 1 : 1=Output the longest read; 0= don't output the longest read
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
86
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
87 -d or -doCommify 0 or 1 : Output numbers formatted with commas to make easier to read: 0=no commas, default=1
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
88
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
89 -f or -format w or t : w=wiki_format (ie. table with || and | for column dividers), t=tabs between column symbols for the wiki pages, default is spaces between columns.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
90
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
91 -b or -bucket1 : To also output histogram file of exact read lengths (ie. bucket size of 1)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
92
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
93
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
94 eg: For 454 reads: fasta_summary.pl -i RawReads.fna -o read_stats -t read
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
95 For 454 isotigs: fasta_summary.pl -i 454Isotigs.fna -o isotig_stats -t isotig
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
96
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
97 ";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
98
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
99 GetOptions (
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
100 "infile=s" => \$infile,
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
101 "output_dir=s" => \$output_dir,
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
102 "type=s" => \$type, ## type is 'read' or 'contig' or 'isotig' - for displaying the graph title
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
103 "repeats=i" => \$repeats, # To count simple repeats
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
104 "number=i" => \$num_random_reads_to_output, # For outputting specified number of random reads
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
105 "cutoff=i" => \$cutoff_length, # Give a number of reads to do extra analysis (calculating again the number of reads and number of bases in reads above this length)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
106 "longest=i" => \$longest_read, # Output the longest read.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
107 "doCommify=i" => \$doCommify, # Output numbers formatted with commas to make easier to read: 0=no commas, default=1
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
108 "format=s" => \$format, # "w"=wiki_format (ie. table with || and | for column dividers), "t"=tabs between column symbols for the wiki pages, default is spaces between columns.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
109 "bucket1" => \$bucket1, # To also output histogram file of exact read lengths (ie. bucket size of 1)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
110 );
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
111 if ($#ARGV>-1) {die "Unused options specified: @ARGV\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
112 if ( (! defined $infile) || ($infile eq '') ) {die "\nPlease give input fasta file, preceeded by the '-i' option\n\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
113 if ( (! defined $output_dir) || ($output_dir eq '') ) {die "Please give output_directory, preceeded by the '-o' option\n\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
114 if ( (! defined $type) || (($type ne 'contig') && ($type ne 'read') && ($type ne 'isotig')) ) {die "ERROR: On commandline: -t type must be 'contig' or 'read' or 'isotig'\n\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
115
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
116
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
117 my ($L,$M,$R, $Lh,$Mh,$Rh, $Lhnewline,$Mhnotab);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
118 if ($format eq 's') {($L,$M,$R, $Lh,$Mh,$Rh, $Lhnewline,$Mhnotab)=('',' ','', '',' ','', "\n",'');}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
119 elsif ($format eq 't') {($L,$M,$R, $Lh,$Mh,$Rh, $Lhnewline,$Mhnotab)=("\t","\t",'', "","\t",'', "\n",'');} # There is correctly a tab for the $L, but not the $Lh.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
120 elsif ($format eq 'w') {($L,$M,$R, $Lh,$Mh,$Rh, $Lhnewline,$Mhnotab)=('| ',' | ',' |', '|| ',' || ',' ||', '|| ',' || ');}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
121 else {die "\nInvalid output format code: '$format'. Should be 's', 't' or 'w'.\n\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
122
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
123 ### create output_dir if it doesn't exist
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
124 if (-d $output_dir) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
125 print STDERR " Directory '$output_dir' exists, so the existing fasta_summary.pl output files will be overwritten\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
126 } else {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
127 mkdir $output_dir;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
128 print STDERR " Directory '$output_dir' created\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
129 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
130
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
131 my $gc_count = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
132
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
133 #--------------- Read in contigs from fasta file -------------------
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
134
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
135 open INFILE, "<$infile" or die "Failed to open file: '$infile' : $!";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
136 open STATS, ">$output_dir/stats.txt" or die "Failed to open $output_dir/stats.txt: '' : $!";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
137
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
138 my $header = <INFILE>;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
139 if (! defined($header) ) {print "\n** ERROR: First line of input fasta file is undefined - so file must be empty **\n\n"; print STATS "No sequences found\n"; exit 1;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
140 if ($header!~/^>/) {print "\nERROR: First line of input fasta file should start with '>' BUT first line is: '$header'\n"; print STATS "No sequences found\n"; exit 1;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
141
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
142 my $seq = "";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
143 my @sequences;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
144
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
145 while (<INFILE>) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
146 if (/^>/) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
147 push @sequences, [length($seq), $header, $seq];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
148 $header = $_;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
149 $seq = "";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
150 } else {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
151 chomp;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
152 $gc_count += tr/gcGC/gcGC/;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
153 $seq .= $_;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
154 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
155 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
156 push @sequences, [length($seq), $header, $seq];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
157 close INFILE;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
158 if ($#sequences==-1) {print "\nERROR: There are zero sequences in the input file: $infile\n\n"; print STATS "No sequences found\n"; exit 1;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
159
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
160
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
161 my $all_contigs_length=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
162 foreach (@sequences) {$all_contigs_length += $_->[0];}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
163 if ($all_contigs_length==0) {print "\nERROR: Length of all contigs is zero\n\n"; exit 2;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
164
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
165 # Find number and number of bases in reads greater than the optional cut-off length given at command-line.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
166 my $num_reads_above_cutoff=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
167 my $num_of_bases_in_reads_above_cutoff=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
168 if ($cutoff_length>0)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
169 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
170 foreach (@sequences)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
171 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
172 if ($_->[0]>=$cutoff_length) {$num_of_bases_in_reads_above_cutoff+= $_->[0]; $num_reads_above_cutoff++;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
173 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
174 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
175
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
176
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
177 #--------------- Gather Plots Data, Find N50, Print sorted contig file -------------------
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
178
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
179 my $summed_contig_length = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
180 my @summed_contig_data; # <-- For graph of summed length (in number of bases) versus number of contigs.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
181 my @summed_contig_data_contigLens; # <-- Added by SJBridgett to get graph of summed contig length versus min. contig length included (ie. X-axis is sort of inverse of above)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
182
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
183 my $contig1k_count = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
184 my $contig1k_length = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
185
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
186 open SORTED, ">$output_dir/sorted_contigs.fa" or die $!;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
187
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
188 # top row in stats file
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
189 #print STATS "N50\nMax contig size\nNumber of bases in contigs\nNumber of contigs\nNumber of contigs >=1kb\nNumber of contigs in N50\nNumber of bases in contigs >=1kb\nGC Content of contigs\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
190
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
191 my $N50size=-1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
192 my $N50_contigs = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
193
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
194 my @sorted_by_contig_length = sort {$b->[0] <=> $a->[0]} @sequences;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
195
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
196 ### variables and initialization for histogram (stored in @bins)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
197 my $max = $sorted_by_contig_length[0][0];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
198 my $mean= $all_contigs_length/($#sequences+1); # <-- Added by Stephen Bridgett. Note: as $# gives the highest index number, so add 1 as arrays are zero-based.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
199
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
200 # Calculate standard deviation
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
201 my $sumsquares = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
202 foreach (@sequences) {$sumsquares += ($_->[0] - $mean) ** 2;} # <-- Taken from John's "mean_fasta_length.pl" script.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
203 my $stddev = ( $sumsquares/($#sequences+1) ) ** 0.5;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
204
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
205 my $min = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
206 # Aim for approximately 100 bins, so
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
207
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
208 my $bin_size=1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
209 my $min_max_range=$max - $min;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
210 # $bin_size = ($min_max_range)/(99); # (99 is 100-1) so 1000/100
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
211 if ($min_max_range>=100000000) {$bin_size=1000000;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
212 elsif ($min_max_range>=10000000) {$bin_size=100000;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
213 elsif ($min_max_range>=1000000) {$bin_size=10000;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
214 elsif ($min_max_range>=100000) {$bin_size=1000;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
215 elsif ($min_max_range>=10000) {$bin_size=100;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
216 else {$bin_size=10;} # elsif ($min_max_range>=1000) {$bin_size=10;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
217 #elsif ($min_max_range>=100) {$bin_size=1;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
218 #elsif ($min_max_range>=10) {}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
219 #elsif ($min_max_range>=1) {}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
220 # WAS: my $bin_size = ($type eq 'contig') ? 1000 : 10;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
221
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
222 my @bins;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
223 $#bins = int(($min_max_range)/$bin_size) + 1; # <-- Set the bins array size.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
224 foreach (@bins) {$_ = 0};
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
225
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
226 foreach (@sorted_by_contig_length) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
227
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
228 my $curr_contig_length = $_->[0];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
229 push @summed_contig_data_contigLens, $curr_contig_length; # <-- added by Stephen.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
230
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
231 $bins[int(($curr_contig_length + 1 - $min)/$bin_size)]++;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
232
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
233 $summed_contig_length += $curr_contig_length;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
234 push @summed_contig_data, $summed_contig_length;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
235
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
236 ### sorted contigs file
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
237 print SORTED $_->[1] . $_->[2] . "\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
238
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
239 if ($curr_contig_length >= 1000) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
240 $contig1k_count++;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
241 $contig1k_length += $curr_contig_length;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
242 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
243
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
244 $N50_contigs++ unless ($N50size>-1); # Was unless $N50_found
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
245
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
246 if ($summed_contig_length > ($all_contigs_length / 2) and $N50size == -1) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
247 $N50size = $curr_contig_length;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
248 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
249 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
250
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
251
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
252 if ($bucket1!=0)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
253 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
254 =pod
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
255 # This firsdt method works and agress with the second, but the lengths are in reverse order, at the @sorted_by_contig_length array was sorted with longest contig first.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
256 open BUCKET1, ">$output_dir/lengths_hist1.txt" or die "Failed to open file '$output_dir/lengths_hist1.txt' : $!\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
257 print BUCKET1 "Length\tFrequency\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
258 my $len=-1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
259 my $count=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
260 foreach (@sorted_by_contig_length)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
261 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
262 if ( $len != $_->[0] ) {if ($len>-1) {print BUCKET1 "$len\t$count\n";} $len=$_->[0]; $count=0;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
263 $count++;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
264 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
265 if ($len>-1) {print BUCKET1 "$len\t$count\n";} # Print length of final length grouping.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
266 close BUCKET1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
267 =cut
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
268 open BUCKET1, ">$output_dir/lengths_hist1_with_zeros.txt" or die "Failed to open file '$output_dir/lengths_hist1_with_zeros.txt' : $!\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
269 print BUCKET1 "Length\tFrequency\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
270 my @bucket=(); # To check the result by using array.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
271 foreach (@sequences)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
272 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
273 my $len=$_->[0];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
274 if (defined $bucket[$len]) {$bucket[$len]++;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
275 else {$bucket[$len]=1;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
276 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
277 for (my $i=0; $i<=$#bucket; $i++)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
278 # for (my $i=$#bucket; $i>=0; $i--) # <-- for reverse order
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
279 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
280 if (defined $bucket[$i]) {print BUCKET1 "$i\t$bucket[$i]\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
281 else {print BUCKET1 "$i\t0\n";} # Can uncomment this later if don't want zeros in the output.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
282 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
283 close BUCKET1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
284 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
285
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
286
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
287 my $type_plural=$type.'s';
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
288 print STATS $Lh."Statistics for $type lengths:".$Mhnotab.$Rh."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
289 print STATS $L."Min $type length:".$M.&commify_if($sorted_by_contig_length[$#sequences][0],$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
290 print STATS $L."Max $type length:".$M.&commify_if($max,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
291 printf STATS $L."Mean %s length:".$M."%.2f".$R."\n", $type,$mean; # <-- Added by Stephen Bridgett, April 2009.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
292 printf STATS $L."Standard deviation of %s length:".$M."%.2f".$R."\n", $type,$stddev; ## <-- Added by Stephen Bridgett, May 2009.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
293 print STATS $L."Median $type length:".$M.&commify_if($sorted_by_contig_length[int($#sequences/2)][0],$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
294 print STATS $L."N50 $type length:".$M.&commify_if($N50size,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
295
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
296 print STATS $Lhnewline."Statistics for numbers of $type_plural:".$Mhnotab.$Rh."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
297 print STATS $L."Number of $type_plural:".$M.&commify_if($#sequences+1,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
298 print STATS $L."Number of $type_plural >=1kb:".$M.&commify_if($contig1k_count,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
299 print STATS $L."Number of $type_plural in N50:".$M.&commify_if($N50_contigs,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
300
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
301 print STATS $Lhnewline."Statistics for bases in the $type_plural:".$Mhnotab.$Rh."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
302 print STATS $L."Number of bases in all $type_plural:".$M.&commify_if($all_contigs_length,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
303 print STATS $L."Number of bases in $type_plural >=1kb:".$M.&commify_if($contig1k_length,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
304 printf STATS $L."GC Content of %s:".$M."%.2f %%".$R."\n", $type_plural,(100*$gc_count/$all_contigs_length);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
305
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
306 if ($cutoff_length>0)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
307 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
308 print STATS $Lhnewline."Statistics for $type_plural >= $cutoff_length bp in length:".$Mhnotab.$Rh."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
309 print STATS $L."Number of $type_plural >= $cutoff_length bp:".$M.&commify($num_reads_above_cutoff,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
310 print STATS $L."\tNumber of bases in $type_plural >= $cutoff_length bp:".$M.&commify($num_of_bases_in_reads_above_cutoff,$doCommify).$R."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
311 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
312
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
313 if ($repeats==1) {&countRepeats();}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
314
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
315 print STATS "\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
316
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
317
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
318 # Output random selection of reads if requested on commandline:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
319 my $fastaLineLen=60; # <-- The line length used for 454 sffinfo output, but could use a value read from input file (but be careful not to read a short line)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
320 if ($num_random_reads_to_output>0)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
321 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
322 my @randlist;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
323 if ($num_random_reads_to_output<($#sequences+1))
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
324 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
325 print STATS "\nSome randomly selected reads:\n\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
326 @randlist= &getListOfRandomNumbers($#sequences, $num_random_reads_to_output); # Don't use ($#sequences + 1), just ($#sequences) otherwise would be outside the array.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
327 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
328 else # Just print all the sequences:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
329 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
330 print STATS "\nAll ".($#sequences+1)." reads:\n\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
331 for (my $i=0;$i<=$#sequences;$i++) {push @randlist,$i;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
332 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
333 &print_sequences(\@randlist)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
334 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
335
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
336
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
337 # Print the longest read:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
338 if ($longest_read>0)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
339 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
340 my $length_of_longest_read=-1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
341 my @longest_read=();
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
342 my $i=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
343 foreach (@sequences)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
344 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
345 if ($_->[0]>$length_of_longest_read) {$length_of_longest_read=$_->[0]; $longest_read[0]=$i;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
346 $i++;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
347 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
348 if ($length_of_longest_read>0) {print STATS "\nLongest read:\n"}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
349 &print_sequences(\@longest_read);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
350 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
351
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
352
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
353 =pod
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
354 print STATS "\n$type\tSummed\nlength\tlength\n"; # <-- Added by Stephen Bridgett, but better to produce a graph instead.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
355
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
356 my $i=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
357 foreach (@summed_contig_data) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
358 # print STATS $sorted_by_contig_length[$i]->[0]."\t".$summed_contig_data_contigLens[$i]."\t".$_."\t".$summed_contig_data[$i]."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
359 print STATS $sorted_by_contig_length[$i]->[0]."\t".$_."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
360 $i++;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
361 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
362 =cut
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
363
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
364 open SUMMED, ">$output_dir/summed_contig_lengths.dat" or die $!;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
365 print SUMMED join "\n",@summed_contig_data;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
366 close SUMMED;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
367
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
368 open HISTOGRAMBINS, ">$output_dir/histogram_bins.dat" or die $!;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
369 my $bin_size_counter = 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
370 foreach (@bins) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
371 print HISTOGRAMBINS eval($bin_size_counter++ * $bin_size + $bin_size/2) . "\t$_\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
372 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
373 close HISTOGRAMBINS;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
374
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
375
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
376 # Graph of cumulative (summed) number of reads on y-axis, versus length of read (decending order) on x-axis
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
377 open SUMREAD_READLEN, ">$output_dir/sum_reads_vs_read_len.dat" or die $!;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
378 #my $read_counter= 0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
379 my $read_counter= $#sorted_by_contig_length+1;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
380
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
381 foreach (@sorted_by_contig_length) {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
382 # $read_counter++;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
383 $read_counter--;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
384 print SUMREAD_READLEN "$_->[0]\n"; # $read_counter
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
385 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
386 close SUMREAD_READLEN;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
387
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
388
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
389
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
390
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
391 my $properType=ucfirst($type); # Makes the first letter an upper case letter, ie. 'Config' or 'Read'
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
392 #if ($type eq 'contig')
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
393 # {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
394 # print the outcome of the gnu_plot as may have a write permissions error sometimes.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
395 my $YHistogramScaleType = ($type eq 'read') ? '' : 'log y'; # Not using log scale for reads, just for contig/isotigs.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
396 &plot_graph('histogram', "$output_dir/histogram_bins.dat", "Histogram of $type lengths", "$properType length", "Number of $type_plural", '0.9', $YHistogramScaleType);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
397 &plot_graph('line', "$output_dir/summed_contig_lengths.dat", "Summed $type lengths", "Number of $type_plural", "Summed $type length in bases", '0.9', '');
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
398 &plot_graph('line', "$output_dir/sum_reads_vs_read_len.dat", "X-axis gives the Number of $type_plural that are greater than the $properType-length given on the Y-axis", "$properType length", "Cummulative number of $type_plural", '0.9', '');
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
399
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
400 =pod
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
401 # print `gnuplot_histogram.sh $output_dir/histogram_bins.dat`;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
402
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
403 &plot_graph("$output_dir/summed_contig_lengths.dat", 'Summed contig lengths', 'Number of contigs', 'Summed contig length in bases', '0.9', '');
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
404 # print `gnuplot_summedcontigs.sh $output_dir/summed_contig_lengths.dat`;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
405
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
406 &plot_graph('line', "$output_dir/sum_reads_vs_read_len.dat", 'X-axis gives the Number of contigs that are greater than the Contig-length given on the Y-axis', 'Contig length', 'Cummulative number of contigs', '0.9', '');
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
407 # print `gnuplot_sum_contig_vs_contig_len.sh $output_dir/sum_reads_vs_read_len.dat`;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
408 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
409 elsif ($type eq 'read')
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
410 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
411
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
412 # print `gnuplot_readshistogram_logY.sh $output_dir/histogram_bins.dat`; # There's also optionally a "...._linearY.sh"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
413
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
414 &plot_graph('line', "$output_dir/summed_contig_lengths.dat",'Summed read lengths', 'Number of reads', 'Summed read length in bases', '0.9', '');
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
415 # print `gnuplot_summedreads.sh $output_dir/summed_contig_lengths.dat`;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
416
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
417 &plot_graph('line', "$output_dir/sum_reads_vs_read_len.dat", 'X-axis gives the Number of reads that are greater than the Read-length given on the Y-axis', 'Read length', 'Cummulative number of reads', '0.9', '');
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
418 # print `gnuplot_sum_reads_vs_read_len.sh $output_dir/sum_reads_vs_read_len.dat`;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
419 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
420 else {die "\n** ERROR: Invalid type='$type' **\n\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
421 =cut
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
422
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
423 close SORTED;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
424 close STATS;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
425
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
426
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
427 # Use pipe to plot directly with gnuplot, rather than calling a separate shell script:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
428 # http://www.vioan.ro/wp/2008/09/30/calling-gnuplot-from-perl/
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
429 # http://forums.devshed.com/perl-programming-6/plotting-with-gnuplot-within-perl-script-549682.html
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
430 # Another option is the perl module: GnuplotIF: http://lug.fh-swf.de/perl/GnuplotIF.html OR: http://lug.fh-swf.de/perl/
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
431
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
432 # PlPlot: Perl: http://search.cpan.org/~dhunt/PDL-Graphics-PLplot-0.47/plplot.pd
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
433 # http://plplot.sourceforge.net/
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
434 # dislin: http://www.mps.mpg.de/dislin/overview.html
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
435 # MathGL: http://mathgl.sourceforge.net/index.html
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
436
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
437
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
438 sub plot_graph
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
439 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
440 # Plots a histogram or xy-line graph
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
441 # Parameters: GraphType (histogram/line) DataFile, Title, X-label, Y-label, Y-range
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
442 # Graphfile should end with '.png'
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
443 # The $yloglinear is 'log y' for log, or '' for linear
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
444 my ($graphtype, $datafile, $title,$xlabel,$ylabel,$yrange,$yloglinear)=@_; # yrange for reads: 0.1, and for contigs: 0.9
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
445
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
446 my $graphstyle='';
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
447 if ($graphtype eq 'histogram') {$graphstyle="plot \"$datafile\" using 1:2 with boxes";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
448 elsif ($graphtype eq 'line') {$graphstyle="plot \"$datafile\" using 1 with lines";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
449 else {die "\n** ERROR: Invalid graphtype='$graphtype'\n\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
450 my $yloglinearscale= ($yloglinear eq '') ? '' : "set $yloglinear";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
451
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
452 # To capture any errors that are normally sent from gnuplot to stderr, could use: open3 pipe interface:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
453 # http://www.clintoneast.com/articles/perl-open3-example.php
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
454 # http://hell.org.ua/Docs/oreilly/perl2/prog/ch16_03.htm
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
455 # But the following should be fine, as the stderr will display when running the script anyway.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
456 # If needed a simpler way would be to sent the output to a file using eg: open (GNUPLOT, "|gnuplot > gnu_out.txt 2>&1") or die .... The read the resulting file.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
457 open (GNUPLOT, "|gnuplot") or die "\n**ERROR: Failed to open gnuplot : $!\n\n **";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
458 print GNUPLOT <<ENDPLOT;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
459 set terminal png
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
460 set output "$datafile.png"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
461 set nokey
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
462 $yloglinearscale
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
463 set xlabel "$xlabel"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
464 set ylabel "$ylabel"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
465 set yrange [$yrange:]
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
466 set title "$title"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
467 $graphstyle
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
468 ENDPLOT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
469 close(GNUPLOT);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
470 if ($? != 0) {print "\n** WARNING: GNUplot pipe returned non-zero status: '$?'\n\n";} # $? is the status returned by the last pipe close (or backtick or system operator)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
471 if (! -e "$datafile.png") {die "\n** ERROR: Failed to create '$datafile.png'**\n\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
472
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
473 =pod
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
474 #PNG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
475 set term png small xFFFFFF
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
476 set output "$file.png"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
477 set size 1 ,1
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
478 set nokey
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
479 set data style line
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
480 set xlabel "frequency" font "VeraMono,10"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
481 set title "Fast Fourier Transform" font "VeraMono,10"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
482 set grid xtics ytics
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
483 set xtics 100
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
484 plot "$file" using 1:2 w lines 1
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
485 =cut
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
486
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
487 #WAS PREVIOUSLY AS .sh script
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
488 =pod
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
489 # The 'gnuplot_readshistogram_logY.sh' is:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
490 set terminal png
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
491 set output "$1.png"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
492 set log y
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
493 set xlabel "Read length"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
494 set ylabel "Frequency"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
495 set yrange [0.9:]
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
496 set title "Histogram of read lengths"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
497 plot "$1" using 1:2 with boxes
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
498 =cut
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
499 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
500
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
501
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
502 # Was previously a separate .sh file:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
503 =pod
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
504 #!/bin/sh
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
505 gnuplot << EOF
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
506 set terminal png
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
507 set output "$1.png"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
508 set xlabel "Number of contigs"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
509 set ylabel "Summed contig length in bases"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
510 set yrange [0.9:]
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
511 set title "Summed contig lengths"
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
512 plot "$1" using 1 with lines
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
513 EOF
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
514 =cut
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
515
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
516
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
517
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
518
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
519 # Added function to count number of simple dinucleotide repeats:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
520 sub countRepeats
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
521 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
522 # To count the number of sequences that contain mostly repeats.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
523 # This would be faster if called a C program on the file.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
524
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
525 # Common simple repeats are listed here: http://www.bioinfo.de/isb/2005/05/0041/
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
526 # Dinucleotide
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
527 # AT/TA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
528 # AC/TG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
529 # AG/TC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
530 # CG/GC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
531 # Trinucleotide
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
532 # AAT/TTA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
533 # CTA/GAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
534 # ATG/TAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
535 # ACT/TGA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
536 # CTC/GAG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
537 # AGG/TCC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
538 # CAG/GTC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
539 # AAG/TTC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
540 # ATA/TAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
541 # CAA/GTT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
542 # AGC/TCG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
543 # ACA/TGT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
544 # ACG/TGC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
545 # AGA/TCT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
546 # ACC/TGG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
547 # Other
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
548 # Tetranucleotide
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
549 # AAAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
550 # AAAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
551 # CACG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
552 # AACA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
553 # AATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
554 # AAGA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
555 # TGAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
556 # AAAG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
557 # ACAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
558 # AATG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
559 # AGCC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
560 # Other
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
561 # Pentanucleotide
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
562 # AAAAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
563 # AATTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
564 # GCTAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
565 # ATAAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
566 # AAAAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
567 # AAACA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
568 # ATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
569 # TTGCC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
570 # Other
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
571
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
572 # I also add mono-nucleotide repeats: - ie. just all T's, or A's, etc
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
573 # Just consider the dinucleotide repeats for now:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
574 my ($ATseq,$CGseq,$ACseq,$TGseq,$AGseq,$TCseq)=(0,0,0,0,0,0);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
575 my ($AAseq,$TTseq,$CCseq,$GGseq)=(0,0,0,0);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
576 foreach (@sequences)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
577 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
578 my $seq_len=$_->[0];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
579 my $seq=$_->[2]; # This copy might be slow, maybe should just stick with using the reference.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
580 my $mnt=0.35*$seq_len; # Mononucleotide threshold: HERE 0.35 also means 70%; 0.4 means 80% dinucleotide repeats, as really one base so 0.5 = 100%
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
581 my $dnt=0.35*$seq_len; # Dinucleotide threshold: 0.35 means 70%; 0.4 means 80% dinucleotide repeats, as two bases so 0.5 = 100%
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
582 my ($AT,$CG,$AC,$TG,$AG,$TC)=(0,0,0,0,0,0);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
583 my ($AA,$TT,$CC,$GG)=(0,0,0,0);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
584 # See: http://www.allinterview.com/showanswers/76719.html
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
585
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
586 # AT/TA seems most common repeat so process it first to save time:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
587 while ($seq=~/AT/g) {$AT++;} if ($AT>$dnt) {$ATseq++; next;} # AT is same as TA. If has 80% AT's then won't have 80% AC etc.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
588 while ($seq=~/CG/g) {$CG++;} if ($CG>$dnt) {$CGseq++; next;} # CG is same as GC.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
589 # AC,TG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
590 while ($seq=~/AC/g) {$AC++;} if ($AC>$dnt) {$ACseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
591 while ($seq=~/TG/g) {$TG++;} if ($TG>$dnt) {$TGseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
592 # AG/TC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
593 while ($seq=~/AG/g) {$AG++;} if ($AG>$dnt) {$AGseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
594 while ($seq=~/TC/g) {$TC++;} if ($TC>$dnt) {$TCseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
595
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
596 # Added my simple mononucleotde repeat count:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
597 while ($seq=~/AA/g) {$AA++;} if ($AA>$mnt) {$AAseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
598 while ($seq=~/TT/g) {$TT++;} if ($TT>$mnt) {$TTseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
599 while ($seq=~/CC/g) {$CC++;} if ($CC>$mnt) {$CCseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
600 while ($seq=~/GG/g) {$GG++;} if ($GG>$mnt) {$GGseq++; next;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
601 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
602
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
603 my $num_seq=($#sequences+1);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
604 my $total_din_repeats_seq= $ACseq+$TGseq+$ATseq+$AGseq+$TCseq+$CGseq;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
605 my $percent_din_repeats=100*$total_din_repeats_seq/$num_seq;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
606 print STATS "\nSimple Dinucleotide repeats:\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
607 printf STATS "\tNumber of %s with over 70%% dinucleotode repeats:\t%.2f %% (%d %s)\n", $type_plural, $percent_din_repeats, $total_din_repeats_seq, $type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
608 printf STATS "\tAT:\t%.2f %% (%d %s)\n", (100*$ATseq/$num_seq),$ATseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
609 printf STATS "\tCG:\t%.2f %% (%d %s)\n", (100*$CGseq/$num_seq),$CGseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
610 printf STATS "\tAC:\t%.2f %% (%d %s)\n", (100*$ACseq/$num_seq),$ACseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
611 printf STATS "\tTG:\t%.2f %% (%d %s)\n", (100*$TGseq/$num_seq),$TGseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
612 printf STATS "\tAG:\t%.2f %% (%d %s)\n", (100*$AGseq/$num_seq),$AGseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
613 printf STATS "\tTC:\t%.2f %% (%d %s)\n", (100*$TCseq/$num_seq),$TCseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
614
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
615 my $total_mono_repeats_seq= $AAseq+$TTseq+$CCseq+$GGseq;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
616 my $percent_mono_repeats=100*$total_mono_repeats_seq/$num_seq;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
617 print STATS "\nSimple mononucleotide repeats:\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
618 printf STATS "\tNumber of %s with over 50%% mononucleotode repeats:\t%.2f %% (%d %s)\n", $type_plural, $percent_mono_repeats, $total_mono_repeats_seq, $type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
619 printf STATS "\tAA:\t%.2f %% (%d %s)\n", (100*$AAseq/$num_seq),$AAseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
620 printf STATS "\tTT:\t%.2f %% (%d %s)\n", (100*$TTseq/$num_seq),$TTseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
621 printf STATS "\tCC:\t%.2f %% (%d %s)\n", (100*$CCseq/$num_seq),$CCseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
622 printf STATS "\tGG:\t%.2f %% (%d %s)\n", (100*$GGseq/$num_seq),$GGseq,$type_plural;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
623
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
624 return $percent_din_repeats+$percent_mono_repeats;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
625 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
626
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
627
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
628 sub commify_if
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
629 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
630 # If doCommify is >0 then converts output to commas.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
631 # Formats '1234567890.01' with commas as "1,234,567,890.01
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
632 # Based on: http://www.perlmonks.org/?node_id=110137
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
633 my ($number,$doCommify)=@_;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
634 if ($doCommify > 0) {$number =~ s/(\d)(?=(\d{3})+(\D|$))/$1\,/g;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
635 return $number;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
636 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
637
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
638
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
639 #--------------- Produce ordered list of random numbers -------------------
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
640 # This is copied from: my_random_contigs.pl
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
641
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
642 sub getListOfRandomNumbers
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
643 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
644 # Use: @list=getListOfRandomNumbers(200,20); to return sorted list of 20 numbers in range from 0 to 200 inclusive.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
645 my %list2=();
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
646 my $i=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
647 my $MaxNumber=$_[0];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
648 my $NumToPick=$_[1];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
649 while ($i<$NumToPick)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
650 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
651 my $intRand = int(rand($MaxNumber+1)); # For Zero-based perl-arrays. The +1 means this generates random integers between 0 and $MaxNumber. (See: http://perldoc.perl.org/functions/rand.html )
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
652 if ($intRand>$MaxNumber) {$intRand=$MaxNumber} # Just to be extra sure that don't exceed $MaxNumber.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
653 if ( !exists($list2{$intRand}) ) {$list2{$intRand}=1; $i++;}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
654 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
655 #foreach my $key(keys %list2) {print "$key ";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
656 # Sort the list of numbers:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
657 #my @SortedList2 = sort { $a <=> $b } keys(%list2);
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
658 #return @SortedList2;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
659 return (sort { $a <=> $b } keys(%list2));
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
660 #print "Sorted list of ".$NumToPick." random numbers:\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
661 #foreach my $num(@SortedList2) {print "$num\n";}
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
662 #print "\n\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
663 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
664
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
665
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
666 sub print_sequences
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
667 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
668 # Print the sequences wrapping sequences using index array, at line length of '$fastaLineLen' characters:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
669 # Uses the global '@sequences' array.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
670 my $sequence_indexes_list=$_[0]; # This is an array reference, not the array itself.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
671 foreach my $num(@{$sequence_indexes_list})
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
672 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
673 #print "$num (max=$#sequences)\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
674 print STATS $sequences[$num]->[1]; # Prints the header, no "\n" needed after it.
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
675 my $pos=0;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
676 my $seqlen=$sequences[$num]->[0];
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
677 while ($pos<$seqlen)
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
678 {
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
679 print STATS substr($sequences[$num]->[2],$pos,$fastaLineLen)."\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
680 $pos+=$fastaLineLen;
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
681 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
682 print STATS "\n";
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
683 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
684 }
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
685
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
686
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
687 =pod
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
688 # Some test runs for mono-nucleotides and dinucelotides:
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
689 >FUOMOGO01AQV42DUMMYA length=339 xy=0189_0676 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
690 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
691 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
692 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
693 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
694 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
695 >FUOMOGO01AQV42DUMMYB length=339 xy=0189_0676 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
696 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
697 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
698 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
699 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
700 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
701 >FUOMOGO01AQV42DUMMYC length=339 xy=0189_0676 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
702 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
703 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
704 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
705 TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
706 >FUOMOGO01AQV42DUMMYD length=339 xy=0189_0676 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
707 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
708 GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
709
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
710 >FUOMOGO01AQV42 length=339 xy=0189_0676 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
711 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
712 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
713 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
714 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
715 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
716 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
717 >FUOMOGO01AUK0D length=214 xy=0231_0843 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
718 ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
719 ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
720 ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
721 ACACACACACACACACACACACGACGACGACGAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
722 >FUOMOGO01AUB7C length=64 xy=0228_1718 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
723 ATATATATATATATATATATATATATATATATATATATATATATATATATAGTACGTACG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
724 TACG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
725 >FUOMOGO01AU00B length=213 xy=0236_1097 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
726 ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
727 ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
728 ACACACACACACACACACACACACACACACACACACACACACACACACACACACACACAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
729 ACACACACACACACACACACGACGACGACGACG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
730 >FUOMOGO01ATYRT length=169 xy=0224_0695 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
731 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
732 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
733 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
734 >FUOMOGO01ARMLN length=400 xy=0197_2201 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
735 TATATATATATATATATATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
736 TATAGTAGTAGTAGTATATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
737 TATATATATATATATATATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
738 TATATATATATATATATATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
739 TATATATATATATATATATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
740 TATATATATATATATATATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
741 TATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
742 >FUOMOGO01AVGRX length=44 xy=0241_1051 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
743 TATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
744 >FUOMOGO01ASZ6K length=315 xy=0213_0922 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
745 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
746 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
747 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
748 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
749 TGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTGTG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
750 TGTGTGTGTGTGTGT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
751 >FUOMOGO01ARSZF length=65 xy=0199_2281 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
752 TATATATATATATATATATATATATATATATATATATATATATATATATATAGTACGTAC
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
753 GTACG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
754 >FUOMOGO01AYV8U length=49 xy=0280_1324 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
755 ATATATATATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
756 >FUOMOGO01AYV9X length=40 xy=0280_1363 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
757 TATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
758 >FUOMOGO01AUX4M length=40 xy=0235_1460 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
759 TATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
760 >FUOMOGO01AWOTU length=54 xy=0255_0800 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
761 ATATATATATATATATATATATATATATATATATATATATATATATATATAGTA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
762 >FUOMOGO01A11TC length=66 xy=0316_1054 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
763 ATATATATATATATATATATATATATATATATATATATATATATATATATATAGTACGTA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
764 CGTACG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
765 >FUOMOGO01ASRJP length=401 xy=0210_2019 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
766 TATATATATATATATATATATATATATATATATATATATATATATATATATATAGTATAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
767 AGTAGTAGTAGTATATATATATATATATATATATATATATATATATATATATATATATAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
768 ATATATATATATATATATATATATATATATATATATATATATATATATATATATATATAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
769 ATATATATATATATATATATATATATATATATATATATATATATATATATATATATATAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
770 ATATATATATATATATATATATATATATATATATATATATATATATATATATATATATAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
771 ATATATATATATATATATATATATATATATATATATATATATATATATATATATATATAT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
772 ATATATATATATATATATATATATATATATATATATATATA
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
773 >FUOMOGO01AU1ZH length=67 xy=0236_2363 region=1 run=R_2009_04_23_17_54_06_
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
774 TATATATATATATATATATATATATATATATATATATATATATATATATATATAGTACGT
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
775 ACGTACG
6544228ea290 Migrated tool version 1.0.1 from old tool shed archive to new tool shed repository
konradpaszkiewicz
parents:
diff changeset
776 =cut