ccagc / QDNAseq

QDNAseq package for Bioconductor
47 stars 27 forks source link

Length of 'dimnames' [2] not equal to array extent #58

Closed RodrigoGM closed 5 years ago

RodrigoGM commented 5 years ago

Hello, I'm finalising an analysis of 895 shallow whole genomes. I'm at the sage of exporting the copyNumbersCalled into a .seg as suggested in the vignette. However, the exportBins(cnd, format = "seg") function keeps generating a dimnames not equal to array extent error at around genome 400 and stops the export. I noticed that the export stalls on a completely 2N genome with no CN aberration at sample 401.

12001 tryCatch(exportBins(copyNumbersCalled, format = "seg"))
12002 Error in dimnames(x) <- dn :
12003   length of 'dimnames' [2] not equal to array extent

Is there a way to skip specific samples to complete the export ? Has anyone encountered this ? is there a permanent fix available ?

Many thanks, any help would be greatly appreciated.

daoud-sie commented 5 years ago

Hi Rodrigo,

With a completely normal 2N genome, there is nothing to write out to the .seg file. We don’t take that into account in processing the samples. I have attached a patched version of the exportSEG function. Simply testing if there are any calls, and if not, skip to generating an empty file with only column names. Can you load this in your session prior to exporting your samples? Let me know if this fixes your problem.

Grtz,

Daoud

Van: Rodrigo Gularte Mérida notifications@github.com Verzonden: vrijdag 25 januari 2019 14:41 Aan: ccagc/QDNAseq QDNAseq@noreply.github.com CC: Subscribed subscribed@noreply.github.com Onderwerp: [ccagc/QDNAseq] Length of 'dimnames' [2] not equal to array extent (#58)

Hello, I'm finalising an analysis of 895 shallow whole genomes. I'm at the sage of exporting the copyNumbersCalled into a .seg as suggested in the vignette. However, the exportBins(cnd, format = "seg") function keeps generating a dimnames not equal to array extent error at around genome 400 and stops the export. I noticed that the export stalls on a completely 2N genome with no CN aberration at sample 401.

12001 tryCatch(exportBins(copyNumbersCalled, format = "seg"))

12002 Error in dimnames(x) <- dn :

12003 length of 'dimnames' [2] not equal to array extent

Is there a way to skip specific samples to complete the export ? Has anyone encountered this ? is there a permanent fix available ?

Many thanks, any help would be greatly appreciated.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/ccagc/QDNAseq/issues/58, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AD-17pTFKaeyqXL-7mArGWNxup-YNZzqks5vGwlygaJpZM4aS5fX.


VUmc disclaimer : www.vumc.nl/disclaimer AMC disclaimer : www.amc.nl/disclaimer

RodrigoGM commented 5 years ago

Thank you for getting back. Sure, I can test the patch, however, I'm not seeing the attachment, could you send it again?

Thanks again,

Rodrigo

RodrigoGM commented 5 years ago

Hello Daoud, Based on our previous discussion, I was able to dive deep into your functions. I coded an includeZero=(TRUE|FALSE) into the exportSEG. The includeZero is used in an if statement to condition the creation of the sel logical vector and either remove both 0 and missing values i.e. sel <- d[,4] != 0 & !is.na(d[,4]) or only missing values sel <- !is.na(d[,4]).

I submitted a pull request and I hope you find the changes useful.

Best,

Rodrigo