shiftFootprintsByExperiment {ORFik} | R Documentation

## Shift footprints of each file in experiment

### Description

For more details, see: `detectRibosomeShifts`

### Usage

    shiftFootprintsByExperiment(
      df,
      out.dir = pasteDir(dirname(df$filepath[1]), "/pshifted/"),
      start = TRUE,
      stop = FALSE,
      top_tx = 10L,
      minFiveUTR = 30L,
      minCDS = 150L,
      minThreeUTR = 30L,
      firstN = 150L,
      min_reads = 1000,
      accepted.lengths = 26:34,
      output_format = c("ofst", "wig"),
      BPPARAM = bpparam(),
      log = TRUE,
      heatmap = FALSE,
      must.be.periodic = TRUE
    )

### Arguments

`df` | an ORFik `experiment`
`out.dir` | output directory for files, default: dirname(df$filepath[1]), making a /pshifted folder at that location
`start` | (logical) Whether to include predictions based on the start codons. Default TRUE.
`stop` | (logical) Whether to include predictions based on the stop codons. Default FASLE. Only use if there exists 3' UTRs for the annotation. If peridicity around stop codon is stronger than at the start codon, use stop instead of start region for p-shifting.
`top_tx` | (integer), default 10. Specify which reads transcripts to use for estimation of the shifts. By default we take top 10 top covered transcripts as they represent less noisy dataset. This is only applicable when there are more than 1000 transcripts.
`minFiveUTR` | (integer) minimum bp for 5' UTR during filtering for the transcripts. Set to NULL if no 5' UTRs exists for annotation.
`minCDS` | (integer) minimum bp for CDS during filtering for the transcripts
`minThreeUTR` | (integer) minimum bp for 3' UTR during filtering for the transcripts. Set to NULL if no 3' UTRs exists for annotation.
`firstN` | (integer) Represents how many bases of the transcripts downstream of start codons to use for initial estimation of the periodicity.
`min_reads` | default (1000), how many reads must a read-length have to be considered for periodicity.
`accepted.lengths` | accepted readlengths, default 26:34, usually ribo-seq is strongest between 27:32.
`output_format` | default c("ofst", "wig"), use export.ofst or wiggle format (wig) using `export.wiggle` ? Default is both. The wig format version can be used in IGV, the score column is counts of that read with that read length, the cigar reference width is lost, ofst is much faster to save and load in R, and retain cigar reference width, but can not be used in IGV. You can also do bedoc format, bed format keeping cigar: `export.bedoc`. bedoc is usually not used for p-shifting.
`BPPARAM` | how many cores/threads to use? default: bpparam()
`log` | logical, default (TRUE), output a log file with parameters used.
`heatmap` | a logical or character string, default FALSE. If TRUE, will plot heatmap of raw reads before p-shifting to console, to see if shifts given make sense. You can also set a filepath to save the file there.
`must.be.periodic` | logical TRUE, if FALSE will not filter on periodic read lengths. (The Fourier transform filter will be skipped).

### Details

#' Saves files to a specified location as .ofst and .wig, The .ofst file will include a score column containing read width.
The .wig fiels, will be saved in pairs of +/- strand, and score column will be replicates of reads starting at that position, score = 5 means 5 reads.
Remember that different species might have different default Ribosome read lengths, for human, mouse etc, normally around 27:30.

### Value

NULL (Objects are saved to out.dir/pshited/"name_pshifted.ofst", wig, bedo or .bedo)

### References

https://bmcgenomics.biomedcentral.com/articles/10.1186/s12864-018-4912-6

### See Also

Other pshifting: `changePointAnalysis()`, `detectRibosomeShifts()`, `shiftFootprints()`

### Examples

    df <- ORFik.template.experiment()
    df <- df[3,] #lets only p-shift RFP sample at index 3
    # If you want to check it in IGV do:
    shiftFootprintsByExperiment(df)
    # Then use the .wig files that are created, which are readable in IGV.
    # If you only need in R, do: (then you get no .wig files)
    #shiftFootprintsByExperiment(df, output_format = "ofst")

[Package ORFik version 1.8.6 Index]