When analyzing a data constructed of individuals (or samples from individuals) of both male and female of a species (e.g. humans), often it is a good idea to compare the distribution of the various studied parameters for the males to those for the females. As for instance in RNAseq analysis, it is the measured expression of many genes may differ significantly between the studied males and females. In other words the gender may exhibit 'batch effect' in the gene expression data. Here is one way to use the neat Venus and Mars signs in an R-plot to label the data related to the females and males. Note that the male and the female signs were just randomly assigned here so no gender batch effect is noticeable in this figure.

#Generate normally distributed random variables
# and organize them in a 50*2 matrix

randM<-matrix(rnorm(100, 500, 50), ncol = 2)

#Output plot into png
png("MaleFemale.png", res=350, width=2000, height=2000)

#Randomly generate 50 MALE or FEMALE signs
gender<- sample(c("M","F"), 50, replace=T)

#Define suitable pch vector based on Unicodes of
#Venus (Female) and Mars (Mars)

pchVec<-rep(-0x2642L, nrow(randM))
pchVec[gender=="F"]<- -0x2640L

# Rndomly assign colors to define 3 subgroups within
#the 50 individuals

colors<- rainbow(3)
colVec<-sample(colors, 50, replace=T)

plot(randM, pch=pchVec, cex=2, col=colVec, xlab="X", ylab="Y")
legend("topleft", legend=c("group1","group2","group3"),
       fill =colors)
dev.off()
0

Add a comment

In this post I show how groupScatterPlot(), function of the rnatoolbox R package can be used for plotting the individual values in several groups toge

In this post I show how classifySex(), function of the rnatoolbox R package can be used for inferring the sex of  the studied subjects from their bina

2
Recently I have started to organize my commonly used functions related to quality assessment and analyzing RNAseq data into an R package.

Many times, in our projects, we may need to compare different measured factors in our samples to one another, and study whether they are linearly depe

2
Many times, in our projects, we may need to compare different measured factors in our samples to one another, and study whether they are linearly depe
Many times, in our projects, we may need to compare different measured factors in our samples to one another, and study whether they are linearly depe
Many times, in our projects, we may need to compare different measured factors in our samples to one another, and study whether they are linearly depe
Occasionally when indexing data frames the format is converted, leading to confusing consequences.

Example of a fastq file in read 1 (in paired read sequencing) is as follows:

@SRR3117565.1.1 1 length=100

NCAAAACAGCTCTCCCTCCTTTGATCTGATGGTCTGCAGAGG

Yesterday (on the opening day of the new Batman movie) I search the Internet for the Batman formula and it's implementations in R.

Yesterday (on the opening day of the new Batman movie) I search the Internet for the Batman formula and it's implementations in R.
Loading