Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Genotype is not available at position # ######## #2

Closed
andhena opened this issue Jun 6, 2018 · 14 comments
Closed

Genotype is not available at position # ######## #2

andhena opened this issue Jun 6, 2018 · 14 comments
Assignees
Labels

Comments

@andhena
Copy link

andhena commented Jun 6, 2018

Dear Paul
I have another question about the One_step_clustering() function.
I ran Control-FREEC on one sample and tried QuantumClone.
Here is what my input SNV file looks like:

head(SNV_file)

  SampleName Chr   Start Depth Alt
1 sample1   1  909419    16   3
2 sample1   1  986894    20   2
3 sample1   1 1262354    95   3
4 sample1   1 1563476    73   2
5 sample1   1 1585590   117   2
6 sample1   1 1654193   247   3

And what the output of Control-FREEC looks like for this sample:

head(CNV_file)

Chromosome  Start    Ratio MedianRatio CopyNumber BAF estimatedBAF Genotype UncertaintyOfGT              Gene
1          1  65535 0.726426    0.508169          1  -1            1        A              -1   1: 65534- 65600
2          1  65857  1.12502    0.508169          1  -1            1        A              -1   1: 65856- 65948
3          1  69091 0.851791    0.508169          1   1            1        A              -1   1: 69090- 70008
4          1 721407 0.524401    0.508169          1  -1            1        A              -1 1: 721406- 721494
5          1 721556 0.876531    0.508169          1  -1            1        A              -1 1: 721555- 721781
6          1 752751  1.17044    0.508169          1   1            1        A              -1 1: 752750- 753582

When I tried the following commands:

SNV_liste = list(SNV_file)
FREEC_liste = list(CNV_file)
contamination = 30
One_step_clustering(SNV_list = SNV_liste, FREEC_list = FREEC_liste, contamination, nclone_range = 2:5, clone_priors = NULL, prior_weight = NULL, Initializations = 1, preclustering = "FLASH", simulated = FALSE, epsilon = NULL, save_plot = TRUE, ncores = 1, restrict.to.AB = FALSE, output_directory = NULL, model.selection = "BIC", optim = "default", keep.all.models = FALSE, force.single.copy = FALSE)

I got:

Checking that SNV_list and FREEC_list have the same number of samples...
Passed
epsilon set to: 0.00566125684264668
Checking all possibilities for sample1
Genotype is not available at position 1 909419
Genotype is not available at position 1 986894
Genotype is not available at position 1 1262354
[...]
Genotype is not available at position 21 47832900
Error in lis[[1]] : subscript out of bounds
In addition: Warning message:
In Patient_schrodinger_cellularities(SNV_list = SNV_list, FREEC_list = FREEC_list,  :
  4931 mutations excluded due to missing genotype or normalization issues

Could you please explain me what I am not doing right?
I guess I could add a genotype column in my snv file but I was hoping I could directly use the output file sample1_ratio.txt from Control-FREEC.
Thank you in advance

Kind Regards
-Charlotte

@DeveauP
Copy link
Owner

DeveauP commented Jun 6, 2018

Hi Charlotte,

First thing, contamination should be between 0 and 1, so using a contamination of 0.3 would reduce the number of variants rejected due to normalization issues.
Second, could you please check that the genotype is not -1 around your position (the line with the Start strictly lower to the variant you are looking at)?

Best wishes,
Paul

@andhena
Copy link
Author

andhena commented Jun 6, 2018

Hi Paul,

Yes indeed, I made a mistake contamination value when I wrote the issue (I noticed as soon as I posted the comment). I actually tested contamination = 0 when I tried to run QuantumClone.

When I check the genotype of the 6 variants detected, I got for instance A, and for UncertaintyOfGT I got -1 :

SNV file

  SampleName Chr   Start Depth Alt
1 sample1   1  909419    16   3
2 sample1   1  986894    20   2
3 sample1   1 1262354    95   3
4 sample1   1 1563476    73   2
5 sample1   1 1585590   117   2
6 sample1   1 1654193   247   3

CNV file

Chromosome	Start	Ratio	MedianRatio	CopyNumber	BAF	estimatedBAF	Genotype	UncertaintyOfGT	Gene
1	909213	0.505172	0.508169	1	1	1	A	-1	1: 909212- 909431
1	986833	0.593654	0.508169	1	-1	1	A	-1	1: 986832- 987025
1	1262621	0.599795	0.508169	1	-1	1	A	-1	1: 1262620- 1263143
1	1563399	0.566113	0.508169	1	1	1	A	-1	1: 1563398- 1563559
1	1585560	0.660535	0.508169	1	1	1	A	-1	1: 1585559- 1585739
1	1654147	0.996888	0.508169	1	-1	1	A	-1	1: 1654146- 1654257

Do you have an idea of what I should do to make it work?

Kind Regards,
-Charlotte

@DeveauP
Copy link
Owner

DeveauP commented Jun 7, 2018

Hi Charlotte,

To prevent any delay in your work, I think the quickest would be to insert the genotype directly in your SNV table.
I'll try to fix the FREEC concatenation as soon as I can using the data you provided, but it may not be before next week.

Best wishes,
Paul

@DeveauP DeveauP self-assigned this Jun 7, 2018
@DeveauP DeveauP added the bug label Jun 7, 2018
@andhena
Copy link
Author

andhena commented Jun 7, 2018

Hi Paul,

Thank you for your answer and your help.
I'll add the genotype in the SNV table in the meantime.

Kind Regards,
-Charlotte

@DeveauP
Copy link
Owner

DeveauP commented Jun 10, 2018

Hi Charlotte,

The QuantumClone version 1.0.0.7 available on Github should fix your issue.

Best wishes,
Paul

@DeveauP DeveauP closed this as completed Jun 10, 2018
@andhena
Copy link
Author

andhena commented Jun 10, 2018

Hi Paul,
Thanks for your doing it so quickly.
Unfortunately I have a new error now :

Checking that SNV_list and FREEC_list have the same number of samples...
Passed
epsilon set to: 0.00566125684264668
Checking all possibilities for <my sample>
Error in `[.data.frame`(z, as.character(z[, "Chromosome"]) == as.character(chr[i])) : 
  undefined columns selected

I tried different things to fix it, including renaming columns but errors are persisting, do you know where this problem comes from?

-Charlotte

@DeveauP
Copy link
Owner

DeveauP commented Jun 11, 2018

Hi Charlotte,

Not having any FREEC file example, I worked on your extract, and used the first line as header. Could you check that there is a "Chromosome" column name?

Best wishes,
Paul

@DeveauP DeveauP reopened this Jun 11, 2018
@andhena
Copy link
Author

andhena commented Jun 11, 2018

Hi Paul,

I'm using the same file, and the column name is "Chromosome" indeed:

> colnames(CNV_file)
 [1] "Chromosome"      "Start"           "Ratio"           "MedianRatio"     "CopyNumber"     
 [6] "BAF"             "estimatedBAF"    "Genotype"        "UncertaintyOfGT" "Gene"   

> head(CNV_file$Chromosome)
[1] 1 1 1 1 1 1
Levels: 1 10 11 12 13 14 15 16 17 18 19 2 20 21 22 3 4 5 6 7 8 9 X

> mode(CNV_file$Chromosome)
[1] "numeric"

Thank you again for your help,

Kind regards
-Charlotte

@DeveauP
Copy link
Owner

DeveauP commented Jun 11, 2018

Hi Charlotte,

I tried a quick fix, tell me if it works (current version on Github).

Paul

@andhena
Copy link
Author

andhena commented Jun 11, 2018

Hi Paul,

Still not working, I've got something slightly different :

Error in `[.data.frame`(z, as.character(z[, ChrCol]) == as.character(chr[i])) : 
  undefined columns selected

-Charlotte

@DeveauP
Copy link
Owner

DeveauP commented Jun 12, 2018

Hi Charlotte,

It seems that object received by the function is not a data.frame anymore. Are you still passing FREEC_list = FREEC_liste as argument or FREEC_list = CNV_file?

Best wishes,
Paul

@andhena
Copy link
Author

andhena commented Jun 13, 2018

Hi Paul,

I'm still passing

SNV_liste = list(SNV_file)
FREEC_liste = list(CNV_file)
contamination = 0
One_step_clustering(SNV_list = SNV_liste, FREEC_list = FREEC_liste, contamination, nclone_range = 2:5, clone_priors = NULL, prior_weight = NULL, Initializations = 1, preclustering = "FLASH", simulated = FALSE, epsilon = NULL, save_plot = TRUE, ncores = 1, restrict.to.AB = FALSE, output_directory = NULL, model.selection = "BIC", optim = "default", keep.all.models = FALSE, force.single.copy = FALSE)

Then I tried FREEC_list = CNV_file just in case but it's not working.

Kind regards,

-Charlotte

@DeveauP
Copy link
Owner

DeveauP commented Jun 30, 2018

Hi Charlotte,

I have been trying to reproduce your error using your file, but to no avail. I cannot figure out what triggers your error as it works on my computer.
Unless you can provide me with a reproducible example, I'll mark this as closed.

Paul

@DeveauP DeveauP closed this as completed Jun 30, 2018
@andhena
Copy link
Author

andhena commented Mar 11, 2019

Hi Paul,
I sent you an email last week with my input files and the complete script I used at quantumclone.package at gmail.com
Thank you for your help and your time,
Best
-Charlotte

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants