r3fang / SnapATAC

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

how can I analyze multiple samples without any barcode ? #90

Closed Ruismart closed 5 years ago

Ruismart commented 5 years ago

hi, I'm testing a few new ATAC tools. I saw SnapATAC on bioRxiv and want to use it to test our own ATAC data, but it's not with barcode, just normal ATAC method. How can I perform SnapATAC using bam files ? I'm following those tutorials, but without barcode step, how can I create the right snap object ?

Ruismart commented 5 years ago

x.sp = createSnap(file = file.list, sample = sample.list ); Epoch: reading the barcode session ... x.sp number of barcodes: 2 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0 table(x.sp@sample)

test-1 test-2 1 1

x.sp = addBmatToSnap(x.sp, bin.size=5000,num.cores=1); Epoch: reading cell-bin count matrix session ... Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE

r3fang commented 5 years ago

Hi there,

Please take a look of the wiki page about how to create a snap file from fastq file. You need to add the barcode to the beginning of each read then follow the tutorial in the wiki page.

Sent from my iPhone

On Sep 9, 2019, at 5:14 AM, Liushaorui notifications@github.com wrote:

x.sp = createSnap(file = file.list, sample = sample.list ); Epoch: reading the barcode session ... x.sp number of barcodes: 2 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0 table(x.sp@sample)

test-1 test-2 1 1

x.sp = addBmatToSnap(x.sp, bin.size=5000,num.cores=1); Epoch: reading cell-bin count matrix session ... Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

r3fang commented 5 years ago

Let me know if you have trouble finding the tutorial

Sent from my iPhone

On Sep 9, 2019, at 5:14 AM, Liushaorui notifications@github.com wrote:

x.sp = createSnap(file = file.list, sample = sample.list ); Epoch: reading the barcode session ... x.sp number of barcodes: 2 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0 table(x.sp@sample)

test-1 test-2 1 1

x.sp = addBmatToSnap(x.sp, bin.size=5000,num.cores=1); Epoch: reading cell-bin count matrix session ... Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

r3fang commented 5 years ago

if you do not have any “standard barcode”, one think you can try is to create a “fake” barcode as “barcode1”, “barcode2” … It should work once they are different strings,

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

On Sep 9, 2019, at 8:53 AM, Fang R. r3fang@eng.ucsd.edu wrote:

Let me know if you have trouble finding the tutorial

Sent from my iPhone

On Sep 9, 2019, at 5:14 AM, Liushaorui <notifications@github.com mailto:notifications@github.com> wrote:

x.sp = createSnap(file = file.list, sample = sample.list ); Epoch: reading the barcode session ... x.sp number of barcodes: 2 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0 table(x.sp@sample)

test-1 test-2 1 1

x.sp = addBmatToSnap(x.sp, bin.size=5000,num.cores=1); Epoch: reading cell-bin count matrix session ... Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE

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

Ruismart commented 5 years ago

Hi,this might not be a barcode issue. I tried to add psudo barcode into my bam files, and run Snaptools , then SnapATAC, and still, in addBmatToSnap step get this error : x.sp = addBmatToSnap(x.sp, bin.size=5000); Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE

x.sp@metaData barcode TN UM PP UQ CM 1 test-1 831666 831666 831643 807295 0 2 test-2 255328 255328 255319 250037 0

x.sp number of barcodes: 2 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0

r3fang commented 5 years ago

Clearly something wrong with the barcode. Can you show me a few reads/lines in your bam file?

Sent from my iPhone

On Sep 10, 2019, at 3:32 AM, Liushaorui notifications@github.com wrote:

Hi,this might not be a barcode issue. I tried to add psudo barcode into my bam files, and run Snaptools , then SnapATAC, and still, in addBmatToSnap step get this error : x.sp = createSnap(file = file.list, sample = sample.list ); Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE

x.sp@metaData barcode TN UM PP UQ CM 1 test-1 831666 831666 831643 807295 0 2 test-2 255328 255328 255319 250037 0

x.sp number of barcodes: 2 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Ruismart commented 5 years ago

Hi, I finally got the snap file right for addBmatToSnap . at first, I also thought my bam files have different structure, so I converted them into bed files, and created snap as the code in FAQ, Still error in addBmatToSnap : "Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE"

usually, error like that might be caused by an illegal “Zero” value (incorrect counting) somewhere. so I tried to merge bed file of each sample with a psudo barcode before “snaptools snap-pre” , then got it right.

it seems that one sample file with only one kind of barcode couldn't build a right snap file, even if merge them in R with SnapATAC, but should merge samples before “snaptools snap-pre”.

x.sp.1 = createSnap(file="Test-1.downsample2000.snap",sample="Test-1") Epoch: reading the barcode session ...

x.sp.1 number of barcodes: 1 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0

x.sp.1@metaData barcode TN UM PP UQ CM 1 ACATTGGCAACCAGGTTGCTGGTATTGGAAGT 2000 2000 2000 1992 0

x.sp.1 = addBmatToSnap(x.sp.1, bin.size=5000, num.cores=1); Epoch: reading cell-bin count matrix session ... Error in (function (cl, name, valueClass) : assignment of an object of class “numeric” is not valid for @‘bmat’ in an object of class “snap”; is(value, "Matrix") is not TRUE

x.sp.1 number of barcodes: 1 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0


x.sp = createSnap(file="Test-1and2.downsample2000.snap",sample="Test-1and2") Epoch: reading the barcode session ...

x.sp number of barcodes: 2 number of bins: 0 number of genes: 0 number of peaks: 0 number of motifs: 0

x.sp@metaData barcode TN UM PP UQ CM 1 ACATTGGCAACCAGGTTGCTGGTATTGGAAGT 2000 2000 2000 1992 0 2 ACATTGGCAAGAGGCAACAAGGATCTAAGCCT 2000 2000 2000 1994 0

x.sp = addBmatToSnap(x.sp, bin.size=5000, num.cores=1); Epoch: reading cell-bin count matrix session ...

x.sp number of barcodes: 2 number of bins: 526765 number of genes: 0 number of peaks: 0 number of motifs: 0