The adhan package is available here !

 The prayer times cannot always be estimated accurately in some places such as countries located in higher latitudes (e.g. the Nordic countries) . as for instance during midsummer time the Fajr may be impossible to estimate or in other words it may simply not exist ! Some Muslim residents of those countries follow Prayer times of other places such as Mecca and Medina. However, day light saving times can make it complicated ! Some align the Dhuhr prayer time of Mecca to the local Dhuhr time and measure all the remaining times based on their differences from Dhuhr in Mecca. This would also resolve complications caused by the daylight saving time. The adhan package facilitates mapping of the prayer times of two locations based on alignment over a specific time (e.g. Dhuhr).  It can also show the prayer times of a city using several methods. The package is dependent on the  Aladhan API.

 The library is available on GACATAG GitHub. It can be installed using install_github() function supported by devtools package.

devtools::install_github("gacatag/adhan")

The following script shows the local prayer times of Helsinki, Finland for today (1st of April 2024), measured by the "Institute of Geophysics, University of Tehran" method. A specific day and month na dyear can also be mentioned. For more info check the parameter settings by typing ?adhan::adhan.

adhan::adhan(city="Helsinki", country="Finland", method=7)
#          date           Fajr        Sunrise          Dhuhr            Asr         Sunset        Maghrib
#  "01-04-2024" "04:07 (EEST)" "06:44 (EEST)" "13:24 (EEST)" "16:50 (EEST)" "20:05 (EEST)" "20:36 (EEST)"
#          Isha          Imsak       Midnight     Firstthird      Lastthird
#"22:02 (EEST)" "03:57 (EEST)" "01:24 (EEST)" "23:38 (EEST)" "03:11 (EEST)"

Currently there are 17 methods which are supported by the Aladhan API. Defining a custom method is also possible. The following shows the Helsinki prayer times for the entire month of April 2024.

HelsinkiAdhanApr2024<- adhan::adhanMonth(
    method="7",
    city="Helsinki",
    country="Finland",
    month=4,
    year=2024)

The following maps the parayer times of Mecca to helsinki by aligning the Dhuhr of the two cities. So the differences of Fajr, Sunrise, Sunset and midnight from Dhuhur (noon) will be similar to those in Mecca however the Dhuhr prayer time itself would be according to Helsinki, Finland.

HelsinkiMeccaAdhanApr2024<- adhan::adhanMapMonth(
    method="7",
    city="Helsinki",
    country="Finland",
    mapCity="Mecca",
    mapCountry="Saudi Arabia",
    mapBy="Dhuhr",
    month=4,
    year=2024)

The tables can be organized into a nicer format using functions from the kableExtra library.

library("kableExtra")

x<- kbl(HelsinkiMeccaAdhanApr2024,
    table.attr = "style='width:100%;'" ) %>%
    kable_classic(full_width = TRUE, position = "center" )

kableExtra::save_kable(x,file="April.pdf")

as_image(x, file="April.png")


Link of the cover photo: https://www.flaticon.com/free-icon/adhan_2918161.

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 together with their mean (or other statistics). I think this is a useful function for plotting grouped data when some groups (or all groups) have few data points ! You may be wondering why to include such function in the rnatoolbox package ?! Well ! I happen to use it quit a bit for plotting expression values of different groups of genes/transcripts in a sample or expression levels of a specific gene/transcript in several sample groups. These expression value are either FPKM, TPM, LCPM, or PSI values (Maybe I should go through these different normalizations later in a different post 😐!). But of course its application is not restricted to gene expression or RNAseq data analysis.

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 binary alignment bam files. The sex can be a source of unwanted variation within the data, for which you may want to adjust your differential gene expression or splicing analysis. However, complete  metadata are unfortunately not always available. Furthermore, sometimes details within metadata are incorrect or have been misplaced due to manual error. Therefore, it is a good practice to quickly double check some details within the data to either complete the missing metadata information or to make sure that the prior stages have been performed without any accidental mix-ups. For muscle tissues, this showed to be useful on our ribo-depleted RNAseq data. NOTE! Earlier the function referred to in this post was named differently(i.e. getGender). Since version 0.2.1 classifySex() is used.

2

Recently I have started to organize my commonly used functions related to quality assessment and analyzing RNAseq data into an R package. It is called rnatoolbox and it is available here. In this post I introduce getMappedReadsCount(), i.e. a function that can be used for checking the number of aligned/mapped fragments in several bam files and detecting the outliers. The outliers are the bam files with oddly high (i.e. exceeding1.5 times the interquartile) and oddly low (i.e. lower than 1.5 times the interquartile) number of mapped fragments.

The adhan package is available here !

The prayer times cannot always be estimated accurately in some places such as countries located in higher latitudes (e.g. the Nordic countries) .

Unsupervised machine learning methods such as hierarchical clustering allow us to discover the trends and patterns of similarity within the data. Here, I demonstrate by using a test data, how to apply the Hierarchical clustering on columns of a test data matrix.

Note ! the & sign is to run the command in background.

Getting MD5 sum for all files and writing it to a txt file in Linux.

md5sum * > myChecklist.txt &

Getting MD5 sum for all files and subfolders and writing it to a txt file in Linux.

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 dependent. These information can also help us to detect covariates and factors that affect our studies but we would like to adjust for/remove their effects (more on this at sometime later). Here, I mention several functions that can be used to perform correlation tests. All of these functions do support both Pearson and ranked (Spearman) methods. Note that in the end of this post I will focus on these two different methods (i.e. Pearson vs Spearman) and show their differences in application.

2

Occasionally when indexing data frames the format is converted, leading to confusing consequences. As for instance, when indexing to select a single column the result is a 'numeric' or 'integer' vector. The following  demonstrates this :

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.

Here is an example of plotting 4 venn diagrams in a single screen with a 2*2 layout.

library(VennDiagram)

#defining vectors

av<- 1:10

bv<- 12:20

cv<-  7:15

# Building venndiagram grid objects (i.e.

1

Planning to draw a density line-plot with gapped (or broken) Y-axis in R, I initially tried out the plotrix package (version 3.8.1). However after facing a couple of problems, I ended up using the standard R graphics codes to draw the correct gapped line-plot.

In January 2018 our lab purchased a modest but good enough espresso machine and coffee grinder. The following table shows the coffee beans that we have used so far to make espresso in our lab.

Many times in my career I have needed to merge several PDF files into a single PDF file. As for instance, the most common format of the PhD thesis in our department is that it begins with a comprehensive review (referred to as 'review of the literature') and continues with several published papers.

1

Ali Oghabian

2019-04-25

The topics covered in this post are:

R and IntEREst version Files in the zip Annotating u12 type introns of HG38 ncRNAs with U12-type introns U12 annotation comparison Reference Files in the zip

You can download the zip file the includes all the scripts and R objects from

Example of a fastq file in read 1 (in paired read sequencing) is as follows: @SRR3117565.1.1 1 length=100 NCAAAACAGCTCTCCCTCCTTTGATCTGATGGTCTGCAGAGGTCCTCAAATCCACACACTGCCACTCTTCAAGACCAACCACTGGGCCTTCTTAATCTCA +SRR3117565.1.1 1 length=100 #1=BDDDDHFHHAHDE?GFEEDHG@HFHEECDCGHE:FDFHD*?DHFDEHHF>;;B<;A;>=A=??@CCCC>5>>AC @SRR3117565.2.1 2 length=100 NTCCTGACTCACACGCCACAACCATGACTGGCTCAGCTCCCTTAATTCCAGCTTCCCTTACATGACGCAATTCCTTCTCAGATTCGGGTTTTCAGCTGAG +SRR3117565.2.1 2 length=100 #4BDFFFFHHHHHJJJJJJJJJJJJJJJJJJJJJJIJJJJJJJJJJJJJJJJJJJJJJJJJJJJJIHHFEFEEEEEEDDEDDDDDDDDBDDDDDDDDDDD

The steps I take to analyse RNA-seq data in the lab are :

Checking mapping qualities, e.g. running fastQC on fastq files. Check the fastQ files to see if any reads cotain the primer (adapter sequence). See Note 3 ↓. This could also be seen in the fastQC (quality checking) results (see fig 1 & 2).

Sometimes painstaking text modifications specially when one is dealing with large data could easily be solved using few lines of scripts of a programming language.

Yesterday (on the opening day of the new Batman movie) I search the Internet for the Batman formula and it's implementations in R. I found several links that used the ggplot2 library however only one was working with the latest version of the package. With minor changes, this is the result that I got for the Batman curve.

I just needed to come up with a name for my blog, so as most of the times, when I'm working in the lab I got some help from my favourite programming language, R. See if you could find a better name with playing a round with the seedNumber, and nameSize parameters.

Labels
Blog Archive
About Me
About Me
My Photo
I am a Postdoc researcher at the Neuromuscular Disorders Research lab and Genetic Determinants of Osteoporosis Research lab, in University of Helsinki and Folkhälsan RC. I specialize in Bioinformatics. I am interested in Machine learning and multi-omics data analysis. My go-to programming language is R.
My Blog List
My Blog List
Loading
Dynamic Views theme. Powered by Blogger. Report Abuse.