The below perl
script produces the metrics.txt
below using the run.txt
as the input.
perl -ne 'BEGIN{print join("\t","R_Index", "ISP Loading", "Pre-Enrichment", "Total Reads", "Read Length", "Key Signal", "Usable Sequence", "Enrichment", "Polyclonal" ,"Low Quality" ,"Test Fragment", "Aligned Bases", "Unaligned Bases",
"Exception"),"\n"};s/[\%\,]//g;@f=split/\s+/;/Aligned Read/ and $ar=$f[-1];/TF/ and $tf||=$f[-1];/Low Quality/ and $lq=$f[-1];/Polyclonal/ and $pc=$f[-1];/Live/ and $en||=$f[-1];/Usable/ and ($il,$us)=@p[1,2];/Key Signal/ and
($ks,$tr,$rl)=@p[3..5];/Unaligned Reads/ and print join("\t",1,$il,".",$tr,$rl,$ks,$us,$en,$pc,$lq,$tf,$ar,$f[-1]," "),"\n";@p=@f' run.txt > metrics.txt
run.txt created using pdftotext -layout
Run Report for Name
Run Summary
20.4 G 84 94,495,222 216 bp 229 bp 275 bp
Total Bases Key Signal Total Reads Mean Median Mode
94% 68% Read Length
ISP Loading Usable Reads
ISP Density ISP Summary
Addressable Wells 148,155,732
With ISPs 139,740,599 94.3%
Live 139,057,205 99.5%
Test Fragment 1,063,667 00.8%
Library 137,993,538 99.2%
Library ISPs 137,993,538
Filtered: Polyclonal 37,959,918 27.5%
Filtered: Low Quality 6,536,035 04.7%
Filtered: Adapter Dimer 349 00.0%
Final Library ISPs 94,495,222 68.5%
Barcode Name Sample Bases Q20 Reads Mean Read Length
No barcode none 151,751,086 122,614,710 844,020 180 bp
IonXpress 004 00-0000 Last- 8,373,945,632 7,188,703,690 38,774,136 216 bp
First
IonXpress 005 00-0001 LastN- 5,226,515,080 4,502,314,522 24,025,446 218 bp
FirstN
IonXpress 006 00-0002 La- 6,651,737,354 5,681,526,265 30,850,757 216 bp
Fi
Test Fragment Reads Percent 50AQ17 Read Length Histogram
TF 1 192,011 86%
1
Run Report for Name
Alignment Summary (aligned to Homo sapiens)
17.01 G 5.5X 98.6%
Total Alignment Bases Average Coverage Mean Raw Accuracy 1x
Depth of Reference
Count %
Total Reads 93,650,339 �
Aligned Reads 93,073,879 99.4%
Unaligned Reads 576,460 0.6%
Alignment Quality
AQ17 AQ20 Perfect
Total Number of Bases [Mbp] 14.9 G 11.2 G 2.55 G
Mean Length [bp] 182 178 130
Longest Alignment [bp] 360 355 336
Mean Coverage Depth 4.8 3.6 0.8
2
Run Report for Name
coverageAnalysis
variantCaller
3
Run Report for Name
Analysis Details
Run Name RunName
Run Date Date and time
Run Flows 500
Projects name
Sample 00-0000 Last-First , 00-0001 LastN-FirstN, 00-0002 La
Reference
Instrument S5-00580
Flow Order TACGTACGTCTGAGCATCGATCGATGTACAGC
Library Key TCAG
TF Key ATCG
Chip ID DACJ01029
Chip Check Passed
Chip Type 540
Chip Data tiled
Chip Lot Number QNC297
Barcode Set IonXpress
Analysis Name Name
Analysis Date Date and time
Analysis Flows 0
runID DLIUA
BeadFind Args justBeadFind �args-json /opt/ion/config/args5 40b eadf ind.json
Analysis Args Analysis �args-json /opt/ion/config/args540analysis.json
Pre-BaseCaller Args BaseCaller �barcode-filter 0.01 �barcode-filter-minreads 10
for calibration �phasing-residual-filter=2.0 �max-phasing-levels 2 �wells-normalization on
Calibration Args Calibration
BaseCaller Args BaseCaller �barcode-filter 0.01 �barcode-filter-minreads 10
�phasing-residual-filter=2.0 �max-phasing-levels 2 �num-unfiltered 1000
�barcode-filter-postpone 1 �wells-normalization on
Alignment Args tmap mapall -q 50000 ... stage1 map4
IonStats Args ionstats alignment
Analysis Parameters default
4
Run Report for Name
Chef Summary
Chef Template Prep Information:
Chef Last Updated Date and time
Chef Instrument Name number
Sample Position 1
Tip Rack Barcode 46C080060
Chip Type 1 540v1
Chip Type 2 540v1
Chip Expiration 1 None
Chip Expiration 2 None
Templating Kit Type Ion 540 Kit-Chef
Reagent Expiration 171031
Reagent Lot Number 1824918
Reagent Part Number A27758C
Solution Lot Number 1817390
Solution Part Number A27754C
Solution Expiration 170731
Chef Script Version 406
Chef Package Version IC.5.2.1
Templating Protocol (use instrument default)
S5 Consumables Summary
Chip Type 540v1
Chip Barcode DACJ01029
Product Description Part Number Lot Number Exp. Date Remaining Uses
Ion S5 Sequencing Reagents 100033230 013309 2017/07/31 1
Ion S5 Cleaning Solution 100031096 013718 2017/12/31 3
Ion S5 Wash Solution 100031090 013315 2017/07/31 1
5
Run Report for Name
Software Version
Torrent Suite 5.2.1
host tsvm
ion-analysis 5.2.25-1
ion-chefupdates 5.2.8
ion-dbreports 5.2.49-1
ion-gpu 5.2.0-1
ion-pipeline 5.2.13-1
ion-plugins 5.2.20-1
ion-protonupdates 5.2.4
ion-s5updates 5.2.7
ion-torrentpy 5.2.2-1
ion-torrentr 5.2.0-1
S5 Script 0.1.16
LiveView 2196
DataCollect 3401
OIA 5208
OS 20
Graphics 86
Ion Chef IC.5.2.1
6
metrics.txt tab-delimeted
R_Index ISP Loading Pre-Enrichment Total Reads Read Length Key Signal Usable Sequence Enrichment Polyclonal Low Quality Test Fragment Aligned Bases Unaligned Bases Exception
1 94 . 94495222 216 84 68 99.5 27.5 04.7 86 99.4 0.6
I am having trouble modifing it to look like the below:
In the run.txt
under Barcode Name the last 4 fields can be found. The naming of the barcode used varies, but the naming format is always the same. So in this run IonXpress 004
, IonXpress 005
, IonXpress 006
were used but in the next run IonXpress 001
, IonXpress 002
, IonXpress 003
may be used. On the run.txt
in the first case the order will be:
Barcode Name Sample Bases Q20 Reads Mean Read Length
No barcode none 151,751,086 122,614,710 844,020 180 bp
IonXpress 004 00-0000 Last- 8,373,945,632 7,188,703,690 38,774,136 216 bp
First
IonXpress 005 00-0001 LastN- 5,226,515,080 4,502,314,522 24,025,446 218 bp
FirstN
IonXpress 006 00-0002 La- 6,651,737,354 5,681,526,265 30,850,757 216 bp
and in the second case the order will be:
Barcode Name
No Barcode
IonXpress 001
IonXpress 002
IonXpress 003
Since I am going to use a few if
statements later each IonXpress
barcode (usually 3, but not always), is set to Barcode1
, Barcode2
, Barcode3
. If the barcode is not present the field is not printed, so if
IonXpress 003
is not present then READS3
is not printed .
The Reads column (f[4] is what is extracted under each IonXpress barcode in the output. The No Barcode is a calculation (844,020 / 94495222) *100). Thank you.
READS TOTAL READS
desired tab-delimited
Read Length Usable Sequence Polyclonal Low Quality Unaligned Bases Barcode1 Barcode2 Barcode3 No Barcode Exception
216 68 27.5 4.7 0.6 38774136 24025446 30850757 0.89
Hopefully, this is a start or maybe there is a better way... thank you :).