DeconstructSigs - Multiple sample size(~90 samples)
1
0
Entering edit mode
7.2 years ago
David_emir ▴ 500

Hi,

I have around 90 Samples (taken from same tissues from different patients) in my .maf files, and i am planning to use deconstructsigs package . I am not stuck about how should be determining the signatures contributing to these 90 samples at a go? Its very difficult to provide sample.id every time. It would be really helpful if you can please help me in this case

For example:

sample_1 = whichSignatures(tumor.ref = sigs.input,
signatures.ref = signatures.nature2013,
sample.id = 1,
contexts.needed = TRUE,
tri.counts.method = 'default')

Should i manually change this every time and generate a graph or can i run these 90 samples together and generate graph at once? Its very confusing to run manually every sample.Please help.

Thanks a ton, Zac

deconstructsigs maf multiple samples • 3.4k views
ADD COMMENT
1
Entering edit mode

If your sample IDs are 1 to 90 why not simply do a loop instead of manually test them all?

sapply(1:90, function(x) whichSignatures(tumor.ref = sigs.input,
signatures.ref = signatures.nature2013,
sample.id = x,
contexts.needed = TRUE,
tri.counts.method = 'default'))

Then combine the results as a single dataframe and process it to graph your results as you like (all together or one by one)

ADD REPLY
0
Entering edit mode

Thanks a lot for your reply, i have sample ids as tumor sample bar codes, like TCGA-IC-A6RF-01A-13D-A33E-09 (96 samples altogether), Can you please guide how best i can run this? i have limited knowledge about coding. Thanks alot

ADD REPLY
1
Entering edit mode
7.2 years ago
VHahaut ★ 1.2k
  1. Create a vector with your sample IDs:

    ids <- c("ID1", "ID2", ... , "IDn")

NB: This can maybe be obtained elsewhere. If you have a dataframe that contain all the IDs in one column you could load this dataframe and extract the IDs:

data <- read.table("file", sep="\t", header=T)
ids <- unique(data$sampleID)
  1. Run the loop using those IDs:

    results <- sapply(ids, function(x) whichSignatures(tumor.ref = sigs.input, signatures.ref = signatures.nature2013, sample.id = x, contexts.needed = TRUE, tri.counts.method = 'default'))
    

This simply says "take my vector of IDs and use them one by one to repeat this function". X will be your ID1 then ID2 then ... up to IDn.

The results should be a dataframe with columns equals to your sample IDs and in the same order so rename the columns:

colnames(results) <- ids

Something like this should work.

ADD COMMENT
0
Entering edit mode

Thanks a Lot this Worked !!! I am very very thankful to you .... I have one last concerns how to save "results" in a .txt file?

ADD REPLY
1
Entering edit mode
write.table(results, "/path/to/your/file.txt", sep="\t", quote=F, row.names=F)
ADD REPLY
0
Entering edit mode

Thanks Lot !!! Its a great help. Thanks again :)

ADD REPLY
0
Entering edit mode

Hi VHahaut, using this method I have a dataframe of my samples. However when I try to do sapply(ids, function(x) makePie(x, sub = x) it gives me an error saying Error in[[.default(sigs.output, "weights") : subscript out of bounds. Any way I should be processing this data?

ADD REPLY

Login before adding your answer.

Traffic: 1632 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6