Skip to content

Instantly share code, notes, and snippets.

@pcantalupo
Created January 14, 2021 14:42
Show Gist options
  • Save pcantalupo/e75d7b9cc5ee645a4a9148e094215b8c to your computer and use it in GitHub Desktop.
Save pcantalupo/e75d7b9cc5ee645a4a9148e094215b8c to your computer and use it in GitHub Desktop.
For this sequence, Guppy mean_qscore_template = 14.09
@5df6a215-bf48-4c72-a961-b483907a6e65
GTGTACTTCGTTCAGTTACGTATTGCTGGTAGCTTTTATCCGTTGAGCGACGGCCATTCCACAATGTACCGCCGGATCACTAAGTCCTGCTTTCCGCACCTGCTCGACTTGTAAGTCTTGCAGTCAACCCTTTTACCTTTGTGCTCTGCATATGGTTTCTGACCATATTGAGTGTAGCTTTGAACGCCTCCGTTACTCTTTAGGAAGCGACCGCCCCAGTCAAACTACCCACCACGCACTCTCCTTCCCAGATAAGGGGAACGGGTTAGAAAATCAATTTAGCAAGGGTGGTATTTCAAGGTTGACTCCACTAGAACTAGCGTCCCAGCTTCAAAGTCTCCCACTGTCTACACATGCTAAACCAATTTTCAATACGAAGTTATAGTAAAGCTCCACGGGGGCTTTTCGTCTTGATACGATAACCAGCGTTTTCACTGGTACCATAATTTCACCGAGTCCAATGTTGAGACAGTAGGGGAGATCATTGCGCCTTTCGTCCCAGCAATATCAGCACCAACAGAAAAGCAATACGTAACT
+
$%%*(9:>5<<B2.=BA02&+))):?AAA@;3BFFB@BLEA8*:=?AB?@C&)02+4837,-333***/77/;=@AC<89,76;;:7.,::=A28+867)*.35<=?;>BADF>;9?ABA<9?=<+,:6$&.336:::=B8C?BIFBB<@E@@<=@B-4/4/0A@IBFE339@B=3,5569==>?7;=CJA=@@;?GDBB:)42)')+7::?9?>?8588:CDB>9*AA?;;6-3$#$$(&,,27;:=:55?;849899<>>+.995::<9D=@CKHLI<A8ALJ>9:B<=<DDFGA*,-:@@<<997=@@<;@EI?@=AAHJH@FGBBB959<22;:D::0*)()3'*78*BDEFJDHA46A>AEGII=A?8.7;A56DEBA:3CFGG>FH@@>@9;93:@BBBC<:@<;972(%')(',,+9@>B=FGLJFAG=??;<ABGE@C@G@?=FB>?5G68=@@DACED:=2.>A=:86')(((:05728*46:<=6-994*0(2<>@GAA@=;523-.1A<@=CA1AGHA7<A?A*('
Here is the algorithm in my script to determine mean quality of the quality string
# Get ASCII value of the character with 'ord' function. Offset is 0 by default
my @chars = split(//, $qual); # convert quality string to array of characters
my $sum = 0;
foreach my $char (@chars) {
my $ascii = ord($char) - $offset;
$sum += $ascii;
}
my $meanqual = $sum/$len;
When I use offset = 0 or 33, the mean quality values do not match Guppy mean_qscore_template
offset = 0 57.9
offset = 33 24.9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment