Clinical-Genomics / clinical_EPPs

EPPs used in clinical genomics LIMS
3 stars 0 forks source link

Updates to pooling script in Twist WF #149

Closed annagellerbring closed 4 years ago

annagellerbring commented 4 years ago

As many adjustments and changes have been made in the TWIST workflow while this issue was developed it was decided (CS and MB) to verify all changes in the same validation. The validation is documented in xxxx .

Lims Issue

Work Flow: TWIST v2 Protocol: Target Enrichment TWIST v1 Step: Pool samples for hybridization TWIST

Description: Updating script for calculating volumes to pool with requirements:

Also investigate: what criteria are giving red QC-flag now? We got red flag for pool D1 and F1 in tga200423 but couldn't understand why (https://clinical-lims.scilifelab.se/clarity/work-complete/142925)

annaengstrom commented 4 years ago

Also add log file to show if and which sample does not have reads (from Set missing reads i Reception control step)

annaengstrom commented 4 years ago

Could we possibly have a discussion on the QC flags in this issue?

mayabrandi commented 4 years ago

I think we had that discussion orally. Total Volume (ul) > 17 is the qc threshod used in this step. Should it be something else?

annaengstrom commented 4 years ago

We used 15 ul as a threshold, but as far as I understood a failed QC flag in a previous step could also make the flag red right? FYI @annagellerbring @christoscoucoravas

mayabrandi commented 4 years ago

A failed QC falg in previous step can not make the qc flagg in this step red. The Set QC script that is run in the step gives a red flag if Total Volume (ul) > 17 The calculate volumes script also stets a red qc flag if Amount taken (ng) <187.5

Maybe you want to take away the Set QC? I think best we talk about it in person!

annaengstrom commented 4 years ago

I think we should only have a red flag if Amount taken (ng) < 187.5 ng, do you agree @annagellerbring and @christoscoucoravas?

christoscoucoravas commented 4 years ago

A failed QC falg in previous step can not make the qc flagg in this step red. The Set QC script that is run in the step gives a red flag if Total Volume (ul) > 17 The calculate volumes script also stets a red qc flag if Amount taken (ng) <187.5

Maybe you want to take away the Set QC? I think best we talk about it in person!

Hello Maya,

Here you write that the Total volume should not exceed 17ul or else QC red flag.

Is that the total volume of the pool or the volume per sample?

Because, I think we need a red QC flag, if the volume of required sample exceeds the 17ul (because that is our maximum volume after Tapestation and Quantit) but the maximum volume of the pool can actually be higher than 17ul.

What do you think? @annaengstrom @annagellerbring @mayabrandi

mayabrandi commented 4 years ago

Hi. Total Volume (ul) is on the pool!

10 juni 2020 kl. 10:26 skrev christoscoucoravas notifications@github.com:

A failed QC falg in previous step can not make the qc flagg in this step red. The Set QC script that is run in the step gives a red flag if Total Volume (ul) > 17 The calculate volumes script also stets a red qc flag if Amount taken (ng) <187.5

Maybe you want to take away the Set QC? I think best we talk about it in person!

Hello Maya,

Here you write that the Total volume should not exceed 17ul or else QC red flag.

Is that the total volume of the pool or the volume per sample?

Because, I think we need a red QC flag, if the volume of required sample exceeds the 17ul (because that is our maximum volume after Tapestation and Quantit) but the maximum volume of the pool can actually be higher than 17ul.

What do you think? @annaengstrom https://github.com/annaengstrom @annagellerbring https://github.com/annagellerbring @mayabrandi https://github.com/mayabrandi — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Clinical-Genomics/clinical_EPPs/issues/149#issuecomment-641833287, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ65XJVWG3J75C6XZHPGATRV47VFANCNFSM4M6ZRIFQ.

annaengstrom commented 4 years ago

Do you agree with this?

Flag should be red if:

annagellerbring commented 4 years ago

Do you agree with this?

Flag should be red if:

  • Amount taken (ng) is <187.5 ng
  • volume for sample to reach 187.5 ng is higher > 15 ul

@annaengstrom Agreed!

mayabrandi commented 4 years ago

Okej. Då implementerar jag det

10 juni 2020 kl. 16:22 skrev annagellerbring notifications@github.com:

Do you agree with this?

Flag should be red if:

Amount taken (ng) is <187.5 ng volume for sample to reach 187.5 ng is higher > 15 ul @annaengstrom https://github.com/annaengstrom Agreed!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Clinical-Genomics/clinical_EPPs/issues/149#issuecomment-642043209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ65XP5KF4XYSJFIMBJB6DRV6JKZANCNFSM4M6ZRIFQ.

annaengstrom commented 4 years ago

Linking this to #142.

If a sample is missing any info required for running the script (for example missing reads) it would be nice to get a log file of what is missing and for which sample.

mayabrandi commented 4 years ago

The volume of a sample in the pool will never be higher than 15 ul:

            for art in artifacts:
                reads = art.samples[0].udf.get('Reads missing (M)')
                concentration = art.udf.get('Concentration')
                if None in [reads, concentration]:
                    self.missing_udfs += ['Reads missing (M)', 'Concentration']
                    total_volume = None
                    break
                fract_of_pool = reads/float(total_reads)
                amount = pool_size * fract_of_pool
                vol = amount/concentration
                if vol>15:
                    vol=15
                if amount<187.5:
                    pool.qc_flag='FAILED'
                    self.amount_fail = True
                art.udf['Amount taken (ng)'] = amount
                art.udf['Volume of sample (ul)'] = vol
                art.put()            
                total_volume += vol

So id say all we need to do is to remove the set qc button.

mayabrandi commented 4 years ago

Regarding missing udf on sample, i prefere to make a check in the step where it is supposed to be set. So that the user can correct it directly. I made a script to check for missing reads. Here is the RP for it https://github.com/Clinical-Genomics/clinical_EPPs/pull/167. Can you test it for me and approve if okey? We can do it together if you want.

cesve commented 4 years ago

Discussion between AG and CS:

for art in artifacts: reads = art.samples[0].udf.get('Reads missing (M)') concentration = art.udf.get('Concentration') if None in [reads, concentration]: self.missing_udfs += ['Reads missing (M)', 'Concentration'] total_volume = None break fract_of_pool = reads/float(total_reads) amount = pool_size * fract_of_pool if amount < "total amount" (recevied from library QC protocol) pool.qc_flag='FAILED'

Dvs: vi vill att provet failar om amount needed är mindre än den totala mängden prov. Det är beroende av antal prov in i poolen, samt hur stor del av poolen provet behöver. Därför kan man ta bort kriteriet 187.5 ng eftersom det endast gäller om det är 8 prov i poolen. Man kan även ta bort kriteriet 15 ul eftersom det fångas upp i "total amount" (som beräknas från conc samt en volym på 15 ul).

@annaengstrom @annagellerbring @mayabrandi does this make sense??

If yes, we should make the change in stage before putting it in production.

annagellerbring commented 4 years ago

Correction: if amount > "total amount" (recevied from library QC protocol) pool.qc_flag='FAILED'

annaengstrom commented 4 years ago

ändra gärna på stage så kan vi testa.

annagellerbring commented 4 years ago

to be discussed between MB, AG and CS on Monday @cesve @mayabrandi

cesve commented 4 years ago

If possible, can we sort the pools in well order in the pooling map? Like: Pool #A1 Pool #B1 Pool #C1 We can name the pools differently if that's needed.

Can we also sort the samples in the pools by there well position: A:1 B:1 C:1 D:1 E:1 F:1 G:1 H:1 A:2 B:2 C:2 and so on.

I have implemented this. Please test it! @cesve

mayabrandi commented 4 years ago

The requested issues above have been implemented and will be verified in issue #128