VanLoo-lab / ascat

ASCAT R package
https://www.mdanderson.org/research/departments-labs-institutes/labs/van-loo-laboratory/resources.html#ASCAT
162 stars 85 forks source link

ASCAT could not find an optimal ploidy and purity value for sample logR. #174

Closed nandakumaryellapu closed 3 months ago

nandakumaryellapu commented 4 months ago

Hello I am I am facing this error while running this function. ascat.runAscat(ascat.bc)

Warning message: In runASCAT(lrr, baf, lrrsegm, bafsegm, ASCATobj$gender[arraynr], : ASCAT could not find an optimal ploidy and purity value for sample logR.

Here I am exaplning the detailed process I have carried out.

# Genertating the nucleotide counts from maftools maftools::gtMarkers (t_bam = Sample_12614-11016.bam", build = "hg38", prefix="chr", fa= "ucsc_hg38")

# Create ASCAT object using the nucleotide counts. ascat.bc = maftools::prepAscat_t(t_counts = "Sample_12614-11016_nucleotide_counts.tsv", min_depth = 15, sample_name = "tumor_only") This is tumor sample and hence used "tumor_only". This process genrated the following files tumor_only.tumour.logR.txt tumor_only.tumour.BAF.txt

The output logR and BAF files were processed with ASCAT without matched normal data protocol

ascat.bc = ASCAT::ascat.loadData(
  Tumor_LogR_file = "tumor_only.tumour.logR.txt",
  Tumor_BAF_file = "tumor_only.tumour.BAF.txt",
  chrs = c(1:22, "X", "Y"),
  sexchromosomes = c("X", "X")
)

ASPCF segmentation

ascat.gg = ASCAT::ascat.predictGermlineGenotypes(ascat.bc)
ascat.bc1 = ascat.aspcf(ascat.bc, ascat.gg=ascat.gg)
ascat.output = ascat.runAscat(ascat.bc1)

Warning message: In runASCAT(lrr, baf, lrrsegm, bafsegm, ASCATobj$gender[arraynr], : ASCAT could not find an optimal ploidy and purity value for sample logR.

I did not get this error with some other samples and I am able to run successfully with further steps. you may follow the link to view the files

[https://drive.google.com/drive/folders/1iN02Z6i9hkh8g3kdkH_ZY7P1qovGmYcT?usp=sharing]

nandakumaryellapu commented 4 months ago

I am waiting for your answer. Would you please add your comments for this issue. Your kind help is greatly appreacited. Thank you

zhangzhhcb commented 4 months ago

Hi, did you do GC correction before the PCF segmentation? Please check the exact steps in the example folder under this link https://github.com/VanLoo-lab/ascat/tree/master/ExampleData.

nandakumaryellapu commented 4 months ago

Thanks for the immediate reply. I fllowed the link you share with me. My samples doent include any normal controls. So I am supposed to follow these steps?

ASCAT run without matched normal data (platform needs to be adapted, see ?ascat.predictGermlineGenotypes)

library(ASCAT)
ascat.bc = ascat.loadData(Tumor_LogR_file = "Tumor_LogR.txt", Tumor_BAF_file = "Tumor_BAF.txt", gender = rep('XX',100), genomeVersion = "hg19")
ascat.plotRawData(ascat.bc, img.prefix = "Before_correction_")
ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = "GC_example.txt", replictimingfile = "RT_example.txt")
ascat.plotRawData(ascat.bc, img.prefix = "After_correction_")
gg = ascat.predictGermlineGenotypes(ascat.bc, platform = "AffySNP6")
ascat.bc = ascat.aspcf(ascat.bc, ascat.gg=gg)
ascat.plotSegmentedData(ascat.bc)
ascat.output = ascat.runAscat(ascat.bc, write_segments = T)
QC = ascat.metrics(ascat.bc,ascat.output)
save(ascat.bc, ascat.output, QC, file = 'ASCAT_objects.Rdata')

if not please let me know.

I guess the follwoing line should be the correction step which actaully i missed ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = "GC_example.txt", replictimingfile = "RT_example.txt")

here you are using "GC_example.txt" and "RT_example.txt" Am i supposed to download these files from your github and use for my GC correction in my samples?

zhangzhhcb commented 4 months ago

Yes. If you do not normal sample, that's the steps you should follow. You could try the GC and RT example data from the GitHub to check if it works. Please be careful about the hg19/hg38 version of your data.

nandakumaryellapu commented 4 months ago

afetr running the follwoing code

ascat.bc = ascat.loadData(
  Tumor_LogR_file = "tumor_only.tumour.logR.txt",
  Tumor_BAF_file = "tumor_only.tumour.BAF.txt",
  gender = rep('XX',100),
  genomeVersion = "hg38")

ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = "GC_example.txt", replictimingfile = "RT_example.txt")

got this error: Error in ascat.correctLogR(ascat.bc, GCcontentfile = "GC_example.txt", : length(ovl) > nrow(ASCATobj$Tumor_LogR)/10 is not TRUE

I tried using "hg19" genomeversion and got the same error. I am unable to figure out this error. Can you please help me

nandakumaryellapu commented 4 months ago

would you please reply

zhangzhhcb commented 3 months ago

Hi, could you attach a piece of your data? I need more details to figure out the issue.

nandakumaryellapu commented 3 months ago

here I am ataching a zip folder that contains the follwoing files

  1. sorted_Sample_142487-123_nucleotide_counts.tsv
  2. tumor_only.tumour.BAF
  3. tumor_only.tumour.logR

example data.zip

Here is follwoing code I am running

Create ASCAT object using the nucleotide counts

ascat.bc = maftools::prepAscat_t(t_counts = "sorted_Sample_142487-123_nucleotide_counts.tsv", min_depth = 15, sample_name = "tumor_only")

The output logR and BAF files from the above step are processed with ASCAT without matched normal data protocol

ascat.bc = ascat.loadData(
  Tumor_LogR_file = "tumor_only.tumour.logR.txt",
  Tumor_BAF_file = "tumor_only.tumour.BAF.txt",
  gender = rep('XX',100),
  genomeVersion = "hg38")

GC correction

ascat.bc = ascat.correctLogR(ascat.bc, GCcontentfile = "GC_example.txt", replictimingfile = "RT_example.txt")

here is the error Error in ascat.correctLogR(ascat.bc, GCcontentfile = "GC_example.txt", : length(ovl) > nrow(ASCATobj$Tumor_LogR)/10 is not TRUE

Please let me know if you need any other information. Happy to provide

nandakumaryellapu commented 3 months ago

Hello Zhang, are you able to figure out something? sorry i am curious to know what is happening with few of the samples like this. Thanks for looking into this issue. I appracite it.

zhangzhhcb commented 3 months ago

Hi, the format of your rowname in both logR and BAF is wrong. You need to format the rownames of BAF and logR as for example "123456", the chromosome and position are seperated by "". I reformat your data and tested on my end. They worked.