r3fang / SnapATAC

Analysis Pipeline for Single Cell ATAC-seq
GNU General Public License v3.0
305 stars 126 forks source link

Warning during barcode selection #44

Closed JBreunig closed 5 years ago

JBreunig commented 5 years ago

I've previously been using your P50 10X brain tutorial without issue but tried the new code for FRIP/UMI selection and get the warning:

x.sp = x.sp[which(x.sp@barcode %in% barcodes.sel$barcode)]; Warning message: In max(i) : no non-missing arguments to max; returning -Inf

This leads to x.sp having 0 barcodes. (prior to that line it has 8033).

The barcodes data.frame has 499703 obs. of 18 variables

Prior to that line, the plots look identical and there are 4098 objects in barcodes.sel

Do you have any suggestions?

Keep up the great work with all of the additions!

r3fang commented 5 years ago

x.sp@barcode probably have different barcodes with barcodes.sel$barcode. The reason for that is because you generated the snap file from fastq file which does not have "-1" in the barcode.

x.sp@barcode = paste(x.sp@barcode, "-1", sep="");

should solve the problem

JBreunig commented 5 years ago

That fixed it, thanks!

r3fang commented 5 years ago

Actually, better use this one, dont change the barcode in snap object x.sp

barcodes.sel$barcode = do.call(c, sapply(barcodes.sel$barcode, function(s) strsplit(s, "-1")))
JBreunig commented 5 years ago

is this ok:
barcodes.sel$barcode = do.call(c, sapply(barcodes.sel$barcode, function(s) strsplit(as.character(s), "-1")))

because I got the warning

Error in strsplit(s, "-1") : non-character argument

initially

JBreunig commented 5 years ago

tutorial completes ok like this, thanks again!

r3fang commented 5 years ago

no problem. anytime!

Rongxin Fang Ph.D. Student, Ren Lab Ludwig Institute for Cancer Research University of California, San Diego

On May 28, 2019, at 6:16 PM, JBreunig notifications@github.com wrote:

tutorial completes ok like this, thanks again!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/r3fang/SnapATAC/issues/44?email_source=notifications&email_token=ABT6GGZFKSY5R4QKJ23BYUDPXWVNFA5CNFSM4HQHC722YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWNTIEQ#issuecomment-496710674, or mute the thread https://github.com/notifications/unsubscribe-auth/ABT6GG5Q6RK56FBVPONPZDTPXWVNFANCNFSM4HQHC72Q.