# HG changeset patch # User devteam # Date 1475663425 14400 # Node ID ffeb59f7a82da14d13f367ddd1742fe7d7daa44d # Parent d31417e25765a925e1cfd77145fb779a6d191094 planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tools/pileup_parser commit ab627176cd4f6efe6d1fe4b85baa679aaa651eb1 diff -r d31417e25765 -r ffeb59f7a82d pileup_parser.pl --- a/pileup_parser.pl Tue Jun 03 12:39:46 2014 -0400 +++ b/pileup_parser.pl Wed Oct 05 06:30:25 2016 -0400 @@ -37,7 +37,7 @@ my @fields = split /\t/; next if $fields[ $ref_base_column ] eq "*"; # skip indel lines my $read_bases = $fields[ $read_bases_column ]; - die "Coverage column" . ($cvrg_column+1) . " contains non-numeric values. Check your input parameters as well as format of input dataset." if ( not isdigit $fields[ $cvrg_column ] ); + die "Coverage column" . ($cvrg_column+1) . " contains non-numeric values. Check your input parameters as well as format of input dataset." if ( not $fields[ $cvrg_column ] =~ qr/^[[:digit:]]+$/x ); next if $fields[ $cvrg_column ] < $cvrg_cutoff; my $base_quality = $fields[ $base_quality_column ]; if ($read_bases =~ m/[\$\^\+-]/) { diff -r d31417e25765 -r ffeb59f7a82d pileup_parser.xml --- a/pileup_parser.xml Tue Jun 03 12:39:46 2014 -0400 +++ b/pileup_parser.xml Wed Oct 05 06:30:25 2016 -0400 @@ -1,5 +1,8 @@ -> + on coverage and SNPs + + perl + #if $pileup_type.type_select == "six" #pileup_parser.pl $input "3" "5" "6" "4" $qv_cutoff $cvrg_cutoff $snps_only $interval "2" $out_file1 $diff $qc_base #elif $pileup_type.type_select == "ten" #pileup_parser.pl $input "3" "9" "10" "8" $qv_cutoff $cvrg_cutoff $snps_only $interval "2" $out_file1 $diff $qc_base @@ -44,7 +47,6 @@ - @@ -93,7 +95,7 @@ - q + @@ -111,10 +113,10 @@ - + - + @@ -127,7 +129,7 @@ - + @@ -143,12 +145,10 @@ - + - - - + **What it does** @@ -169,12 +169,12 @@ **Six column pileup**:: 1 2 3 4 5 6 - --------------------------------- + --------------------------------- chrM 412 A 2 ., II chrM 413 G 4 ..t, IIIH chrM 414 C 4 ..Ta III2 chrM 415 C 4 TTTt III7 - + where:: Column Definition @@ -185,7 +185,7 @@ 4 Coverage (# reads aligning over that position) 5 Bases within reads 6 Quality values (phred33 scale, see Galaxy wiki for more) - + **Ten column pileup** The `ten-column`__ pileup incorporates additional consensus information generated with the *-c* option of the *samtools pileup* command:: @@ -228,7 +228,7 @@ - Number of **C** variants - Number of **G** variants - Number of **T** variants -- Number of read bases covering this position, where quality is equal to or higher than the value set by **Do not consider read bases with quality lower than** option. +- Number of read bases covering this position, where quality is equal to or higher than the value set by **Do not consider read bases with quality lower than** option. Optionally, if **Print total number of differences?** is set to **Yes**, the tool will append the sixth column with the total number of deviants (see below). @@ -246,7 +246,7 @@ chrM 413 G 4 ..t, IIIH 0 0 2 1 3 chrM 414 C 4 ..Ta III2 1 1 0 1 3 chrM 415 C 4 TTTt III7 0 0 0 4 4 - + where:: Column Definition @@ -264,22 +264,21 @@ 11 Quality adjusted coverage: 12 Number of read bases (i.e., # of reads) with quality above the set threshold 13 Total number of deviants (if Convert coordinates to intervals? is set to yes) - + if **Print total number of differences?** is set to **Yes**, you will get:: chrM 413 G 4 ..t, IIIH 0 0 2 1 3 1 chrM 414 C 4 ..Ta III2 1 2 0 1 3 2 - chrM 415 C 4 TTTt III7 0 0 0 4 4 0 - + chrM 415 C 4 TTTt III7 0 0 0 4 4 0 + Note the additional column 13, that contains the number of deviant reads (e.g., there are two deviants, T and a, for position 414). - Finally, if **Convert coordinates to intervals?** is set to **Yes**, you will get one additional column with the end coordinate:: - + chrM 412 413 G 4 ..t, III2 0 0 2 1 3 chrM 414 415 C 4 ..Ta III2 1 2 0 1 3 chrM 414 415 C 4 TTTt III7 0 0 0 4 4 - + where:: Column Definition @@ -299,12 +298,12 @@ 13 Total number of deviants (if Convert coordinates to intervals? is set to yes) -Note that in this case the coordinates of SNPs were converted to intervals, where the start coordinate is 0-based and the end coordinate in 1-based using the UCSC Table Browser convention. - +Note that in this case the coordinates of SNPs were converted to intervals, where the start coordinate is 0-based and the end coordinate in 1-based using the UCSC Table Browser convention. + Although three positions have variants in the original file (413, 414, and 415), only 413 and 415 are reported because the quality values associated with these two SNPs are above the threshold of 20. In the case of 414 the **a** allele has a quality value of 17 ( ord("2")-33 ), and is therefore not reported. Note that five columns have been added to each of the reported lines:: chrM 413 G 4 ..t, IIIH 0 0 2 1 3 - + Here, there is one variant, **t**. Because the fourth column represents **T** counts, it is incremented by 1. The last column shows that at this position, three reads have bases above the quality threshold of 20. ----- @@ -317,17 +316,17 @@ chrM 413 G 4 ..t, III2 chrM 414 C 4 ..Ta III2 chrM 415 C 4 TTTt III7 - + To call all variants (with no restriction by coverage) with quality above phred value of 20, we will need to set the parameters as follows: -.. image:: pileup_parser_help1.png +.. image:: pileup_parser_help1.png Running the tool with these parameters will return:: chrM 413 G 4 ..t, IIIH 0 0 0 1 3 chrM 414 C 4 ..Ta III2 0 2 0 1 3 chrM 415 C 4 TTTt III7 0 0 0 4 4 - + **Note** that position 414 is not reported because the *a* variant has associated quality value of 17 (because ord('2')-33 = 17) and is below the phred threshold of 20 set by the **Count variants with quality above this value** parameter. ----- @@ -336,7 +335,7 @@ In addition to calling variants, it is often useful to know the quality adjusted coverage. Running the tool with these parameters: -.. image:: pileup_parser_help2.png +.. image:: pileup_parser_help2.png will report everything from the original file:: @@ -344,7 +343,7 @@ chrM 413 G 4 ..t, III2 0 0 2 1 3 chrM 414 C 4 ..Ta III2 0 2 0 1 3 chrM 415 C 4 TTTt III7 0 0 0 4 4 - + Here, you can see that although the total coverage at position 414 is 4 (column 4), the quality adjusted coverage is 3 (last column). This is because only three out of four reads have bases with quality above the set threshold of 20 (the actual qualities are III2 or, after conversion, 40, 40, 40, 17). One can use the last column of this dataset to filter out (using Galaxy's **Filter** tool) positions where quality adjusted coverage (last column) is below a set threshold. @@ -363,8 +362,7 @@ chrM 413 G 4 ..t, III2 0 0 2 1 3 1 chrM 414 C 4 ..Ta III2 0 2 0 1 3 1 chrM 415 C 4 TTTt III7 0 0 0 4 4 0 - - + ----- **Example 4**: Report everything, print total number of differences, and ignore qualities and read bases @@ -379,9 +377,7 @@ chrM 413 G 4 0 0 2 1 3 1 chrM 414 C 4 0 2 0 1 3 1 chrM 415 C 4 0 0 0 4 4 0 - - - - + +