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

Error logical subscript too long when training data #5

Open
KhanhLPBao opened this issue Apr 25, 2021 · 10 comments
Open

Error logical subscript too long when training data #5

KhanhLPBao opened this issue Apr 25, 2021 · 10 comments

Comments

@KhanhLPBao
Copy link

I'm trying to train a new batch of data, after loading all .bed file the script show this error and stop

Error in training.frame.sub["X" == training.frame$chr, ] : 
  (subscript) logical subscript too long
Calls: train -> as.data.frame
Execution halted

Does anyone know how to fix it? Thank you very much

@leraman
Copy link
Collaborator

leraman commented Apr 29, 2021

I'm guessing one or more of your bed files have an different number of lines per chromosome? Could you double check they were all created with the same WCX reference?

@KhanhLPBao
Copy link
Author

Sorry for not reply for long time, I will check all files again. Thank you very much

@KhanhLPBao
Copy link
Author

@leraman
I have rerun entire entire samples, check their lines and they are the same but the problem still occured. My procedure including:

  1. Convert .bam to .npz by using WisecondorX
  2. Make the .bed by WisecondorX predict, the reference is the total male sample I made with command:

WisecondorX newref /path/to/samples sampleM.npz --yfrac 0
(I set yfrac = 0 to set all samples are male)

  1. Create .bed file that PREFACE can read by command

cut -f1,2,3,5 *_bins.bed > *.bed

@leraman
Copy link
Collaborator

leraman commented May 14, 2021

You should use --nipt during WisecondorX newref if you want to create a NIPT reference.

@KhanhLPBao
Copy link
Author

KhanhLPBao commented May 21, 2021

@leraman Hi
I have tried to use --nipt but its returned with this output:

A NIPT reference should have at least 5 female feti samples. Removing --nipt flag.

I know the Y chromosome depend on the fetal fraction on the sample, but is there any way can I do to calculate ff based on Y fraction? Because as I mentioned in issue #6 the results are just repeating of 2-3 numbers and the r is very low.

@leraman
Copy link
Collaborator

leraman commented May 28, 2021

For NIPT, you cannot analyze the y chromosome with WisecondorX, so you'll need to use --nipt and don't use --yfrac. We haven't provided code to calculate FFY, but there are multiple possibilities. You'll have to do some custom parsing on the bam files to define an FFY that best fits your protocol.

@cverwimp
Copy link

I encountered the same error, fixed it by replacing line 191 of PREFACE.R with:

training.frame <- training.frame[training.frame$chr != 'Y', ]

@leraman
Copy link
Collaborator

leraman commented Jun 1, 2021

Hi @cverwimp

Did you use WisecondorX (if yes: you should use the --nipt flag, which makes sure there is no Y data) or some other software for copy number profiling?

Thanks,

Lennart

@happenywong
Copy link

I'm trying to train a new batch of data, after loading all .bed file the script show this error and stop

Error in training.frame.sub["X" == training.frame$chr, ] : 
  (subscript) logical subscript too long
Calls: train -> as.data.frame
Execution halted

Does anyone know how to fix it? Thank you very much

I met the same problem, how did you solve it?

@happenywong
Copy link

I encountered the same error, fixed it by replacing line 191 of PREFACE.R with:

training.frame <- training.frame[training.frame$chr != 'Y', ]

I used your method to solve the problem,thank!

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

No branches or pull requests

4 participants