Posts

Empowering RNA-Seq Analysis: Building and Utilizing Your Custom R Package

  Introduction In the vast realm of bioinformatics, understanding gene expression is crucial for unraveling the mysteries of biology and disease. One powerful tool in this pursuit is the R programming language, enriched by packages like DESeq2 for conducting differential gene expression analysis. However, navigating these tools can be complex for beginners. That's where our custom package, MyDataAnalytics, steps in to streamline the process. In this blog post, we'll walk you through the steps of conducting differential gene expression analysis using MyDataAnalytics, simplifying a task that can often seem daunting. Part 1: Creating Your Custom R Package Creating a custom R package involves several steps, from defining functions to structuring directories and documentation. Let's outline the process: Define Functions : Begin by defining functions that encapsulate specific tasks related to RNA-Seq analysis, such as creating DESeqDataSet objects, running DESeq analysis, filteri...
Image
  R Markdown  is a file format for making dynamic documents with  R . An  R Markdown  document is written in  markdown  (an easy-to-write plain text format) and contains chunks of embedded  R  code.  Markdown  is a simple formatting syntax for authoring  HTML, PRESENTATIONS, PDF, and MS Word  documents It has  three types of content  which include text, code chunks and  YAML metadata which build  R Markdown.  ✔ YAML metadata consists of information about the title, author, date, and output. It starts and ends with three dashes  (---) .  ✔ Code chunks can be run without interference from the text. Multiple code chunks of different programming languages like  Python and SQL  can also be included in the same document.  A single code can also be run and output can be viewed for the corresponding code in the R console. A code should start with  ```{r}  and end with...

Mastering Debugging: A Step-by-Step Guide to Fixing Code Errors

Image
  Debugging is a crucial skill for programmers as it assists them in detecting and fixing errors or bugs in their code. In this detailed guide, we will take you through an example of debugging a code snippet and emphasize the essential tactics and tools needed to master the art of debugging. Understanding the Deliberate Bug Let's begin with the code snippet that contains a deliberate bug, which results in an error message during execution. Here's the faulty code, When this code is executed, it triggers an error message due to the unexpected placement of return(outlier.vec) within the for loop. Step 1: Identifying the Error To identify the error, we can use the traceback function, which prints the list of functions called before the error occurred. Running traceback("tukey_multiple") reveals the location of the error just before return(outlier.vec) . Step 2: Using Debugging Tools After locating the error, we implement the debug function to step through the code an...

Building your own 'R PACKAGE' and 'DESCRIPTION' file

Image
A package in R is a standardized and structured unit that comprises various components, including  1. R code 2. Documentation 3. Data 4. External code Creating a package is initiated by generating a new blank project in R. Installing   ' devtools '   and   ' roxygen '   which help in creating packages and can be done by the following code: install.packages(“devtools”) install.packages(“roxygen2”) library(devtools) library(roxygen2) package.skeleton() It can also be installed directly by implementing code   devtools::install_github("hadley/devtools") It creates new files: Data, folder  DESCRIPTION, information file  Man, help folder R folder contains the . R files for functions  And “read-and-delete-me” file The  Description  consists of  fundamental information regarding the package in the following sequence:  The important and required fields are ‘Package’, ‘Version’, ‘License’, ‘Description’, ‘Title’, ‘Author’, and ...