Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    No, that's not the output from bowtie2 (if someone told you that, they were wrong), it's the output from bsmooth's methylation extractor (or at least it looks like it). The aligner that you tell bsmooth to use has no effect on the formatting of the methylation file.

    Comment


    • #17
      ah, ok I understand. So according to the files that I have (I have 3 files like that, 2 treatments and 1 control), what would be better to create the BSseq object? I don´t know who to write the code by only reading the manual

      Comment


      • #18
        Honestly, with just 3 samples there's no point in any statistical test, the results would be useless. Don't waste your time with this dataset.

        Comment


        • #19
          Maybe, but this is the only thing we have and I have to do it anyway...

          should be some like this?:

          read.bsmooth("C:\Users\Gema\Desktop", Sample1.bed, seqnames = NULL, returnRAw = FALSE, qualityCutoff = 20, rmZeroCov = TRUE, verbose = TRUE)

          Comment


          • #20
            I'll also add that after a bit of checking/memory refreshing, the format you posted isn't from bsmooth but is similar to bedGraph format, just with the strand column removed. Adding a strand (e.g., awk 'BEGIN{OFS="\t"}{print $1,$2,$3,".",$4,$5}' somefile > somefile.bedGraph) should allow you to use bedGraph2BSseq.py from bison. The instructions for loading the resulting files into R are in the README.md file.

            Comment


            • #21
              but this command auk is not for R right?

              Comment


              • #22
                Correct, awk is run from the command line.

                Comment


                • #23
                  which would be the equivalent in R?

                  Comment


                  • #24
                    Well, you end up just reading the file into a dataframe, adding a column of "." and writing to a new file in a different order:
                    Code:
                    d <- read.table("somefile", header=F)
                    d$strand = "."
                    write.table(d[,c(1,2,5,3,4)], file="somefile.new", row.names=F, colnames=F)
                    Or something like that. Having said that, perhaps you're lucky and the positions covered in each of the three files are the same. Then you just skip all of that with something like:

                    Code:
                    library(bsseq)
                    files<- c("sample1.file", "sample2.file", "sample3.file")
                    fl <- lapply(files, function(x) read.delim(x, header=F))
                    gr <- GRanges(seqnames=Rle(fl[[1]][,1]), ranges=IRanges(start=fl[[1]][,2], end=fl[[1]][,3]), strand=Rle("*", nrow(fl[[1]])))
                    M <- sapply(fl, function(x) x$[,3])
                    Cov <- sapply(fl, function(x) x$[,4])
                    groups = data.frame(row.names=files, condition=c("WT","Mut","Mut"))
                    BS <- BSseq(M=M, Cov=Cov, gr=gr, pData=groups, samplesNames=samples)
                    or something like that. I've not tested any of that, but it should give you the idea.

                    Given your apparent newness to R, you might want to take a local course before continuing.

                    Comment


                    • #25
                      thank you very much for your help, I´m just starting with R but right now I´m not able to take any course, I will do it during Christmas vacation when I have more time... but I´m pushed to finish this before...

                      thank you very much again for stealing your time

                      Comment


                      • #26
                        I run without errors the code that you wrote me for inserting the column but the output is this:

                        chr1 564495 1 564496 1
                        chr1 564501 1 564502 1
                        chr1 565013 1 565014 1
                        chr1 565040 1 565041 1
                        chr1 565262 8 565263 0
                        chr1 565397 5 565398 1
                        chr1 565469 2 565470 2

                        the columns are not tabulated (all the data in the same column), the "." column is not there and the others are not sorted

                        Comment


                        • #27
                          The last line should instead be:

                          Code:
                          write.table(d[,c(1,2,3,6,4,5)], file="somefile.new", row.names=F, colnames=F)
                          Mea culpa

                          Comment


                          • #28
                            let´s try

                            Comment


                            • #29
                              perfect! big thanks! I´ll try the bsseq object now

                              Comment


                              • #30
                                got this:

                                Code:
                                > M <- sapply(fl, function(x) x$[,4])
                                Error: unexpected '[' in "M <- sapply(fl, function(x) x$["

                                Comment

                                Latest Articles

                                Collapse

                                • seqadmin
                                  Best Practices for Single-Cell Sequencing Analysis
                                  by seqadmin



                                  While isolating and preparing single cells for sequencing was historically the bottleneck, recent technological advancements have shifted the challenge to data analysis. This highlights the rapidly evolving nature of single-cell sequencing. The inherent complexity of single-cell analysis has intensified with the surge in data volume and the incorporation of diverse and more complex datasets. This article explores the challenges in analysis, examines common pitfalls, offers...
                                  Yesterday, 07:15 AM
                                • seqadmin
                                  Latest Developments in Precision Medicine
                                  by seqadmin



                                  Technological advances have led to drastic improvements in the field of precision medicine, enabling more personalized approaches to treatment. This article explores four leading groups that are overcoming many of the challenges of genomic profiling and precision medicine through their innovative platforms and technologies.

                                  Somatic Genomics
                                  “We have such a tremendous amount of genetic diversity that exists within each of us, and not just between us as individuals,”...
                                  05-24-2024, 01:16 PM

                                ad_right_rmr

                                Collapse

                                News

                                Collapse

                                Topics Statistics Last Post
                                Started by seqadmin, Today, 06:58 AM
                                0 responses
                                13 views
                                0 likes
                                Last Post seqadmin  
                                Started by seqadmin, Yesterday, 08:18 AM
                                0 responses
                                19 views
                                0 likes
                                Last Post seqadmin  
                                Started by seqadmin, Yesterday, 08:04 AM
                                0 responses
                                18 views
                                0 likes
                                Last Post seqadmin  
                                Started by seqadmin, 06-03-2024, 06:55 AM
                                0 responses
                                13 views
                                0 likes
                                Last Post seqadmin  
                                Working...
                                X