Tuesday, 30 June 2015
Sunday, 28 June 2015
Conversion Between Decimals and Bits
Decimal to bits
bin(10)
Bits to decimal
int("1011111",2)
bin(10)
Bits to decimal
int("1011111",2)
Friday, 26 June 2015
Thursday, 25 June 2015
Wednesday, 24 June 2015
Tuesday, 23 June 2015
SAM File 1-based Leftmost Mapping Position in Relation to Strand
Cited from Re: [Samtools-help] Questions about SAM format
"It's always the smaller of the two "end"-coordinates, on the positive strand (the strand that is given in your reference fasta). So, in a 100bp reference, if your 25bp read came from / is mapped to the negative strand right up against its 5'-end, the position in the SAM line would be 76. If you have another read that came from the positive strand right up against its 3'-end, the position in the SAM line would *also* be 76. Use the strand flag to distinguish between the two cases."
"It's always the smaller of the two "end"-coordinates, on the positive strand (the strand that is given in your reference fasta). So, in a 100bp reference, if your 25bp read came from / is mapped to the negative strand right up against its 5'-end, the position in the SAM line would be 76. If you have another read that came from the positive strand right up against its 3'-end, the position in the SAM line would *also* be 76. Use the strand flag to distinguish between the two cases."
Identify Ambiguously Mapped Reads in SAM/BAM
Cited from Wiki of PoPOOLationWalkthrough
"Filtering by a mapping qualiy of 20 removes the ambiguously mapped reads
samtools view -q 20 -b -S dmel.sam"
"Filtering by a mapping qualiy of 20 removes the ambiguously mapped reads
samtools view -q 20 -b -S dmel.sam"
Monday, 22 June 2015
Make Manual
Cited from 2.2 A Simple Makefile
When a target is a file, it needs to be recompiled or relinked if any of its prerequisites change.
Targets that do not refer to files but are just actions are called phony targets.
====================================================================
Cited from 2.3 How make Processes a Makefile
By default, make starts with the first target. This is called the default goal.
====================================================================
Cited from 2.6 Another Style of Makefile
When the objects of a makefile are created only by implicit rules, an alternative style of makefile is possible. In this style of makefile, you group entries by their prerequisites instead of by their targets.
====================================================================
Cited from 3.1 What Makefiles Contain
Makefiles contain five kinds of things: explicit rules, implicit rules, variable definitions, directives, and comments.
A directive is an instruction for make to do something special while reading the makefile. These include:
By default, when make looks for the makefile, it tries the following names, in order: GNUmakefile, makefile and Makefile.
The include directive tells make to suspend reading the current makefile and read one or more other makefiles before continuing. The directive is a line in the makefile that looks like this:
Conditional directives are parsed immediately. This means, for example, that automatic variables cannot be used in conditional directives, as automatic variables are not set until the recipe for that rule is invoked. If you need to use automatic variables in a conditional directive you must move the condition into the recipe and use shell conditional syntax instead.
If that special target is defined then in between the two phases mentioned above, right at the end of the read-in phase, all the prerequisites of the targets defined after the special target .SECONDEXPANSION are expanded a second time.
When a target is a file, it needs to be recompiled or relinked if any of its prerequisites change.
Targets that do not refer to files but are just actions are called phony targets.
====================================================================
Cited from 2.3 How make Processes a Makefile
By default, make starts with the first target. This is called the default goal.
====================================================================
Cited from 2.6 Another Style of Makefile
When the objects of a makefile are created only by implicit rules, an alternative style of makefile is possible. In this style of makefile, you group entries by their prerequisites instead of by their targets.
====================================================================
Cited from 3.1 What Makefiles Contain
Makefiles contain five kinds of things: explicit rules, implicit rules, variable definitions, directives, and comments.
An implicit rule says when and how to remake a class of files based on their names. It describes how a target may depend on a file with a name similar to the target and gives a recipe to create or update such a target.
- Reading another makefile
- Deciding (based on the values of variables) whether to use or ignore a part of the makefile (see Conditional Parts of Makefiles).
- Defining a variable from a verbatim string containing multiple lines (see Defining Multi-Line Variables).
====================================================================
Cited from 3.1.1 Splitting Long Lines
The way in which backslash/newline combinations are handled depends on whether the statement is a recipe line or a non-recipe line. Handling of backslash/newline in a recipe line is discussed later (see Splitting Recipe Lines).
Cited from 3.1.1 Splitting Long Lines
The way in which backslash/newline combinations are handled depends on whether the statement is a recipe line or a non-recipe line. Handling of backslash/newline in a recipe line is discussed later (see Splitting Recipe Lines).
====================================================================
Cited from 3.2 What Name to Give Your Makefile
By default, when make looks for the makefile, it tries the following names, in order: GNUmakefile, makefile and Makefile.
====================================================================
Cited from 3.3 Including Other Makefiles
Cited from 3.3 Including Other Makefiles
include filenames…
filenames can contain shell file name patterns. If filenames is empty, nothing is included and no error is printed. If the file names contain any variable or function references, they are expanded.
If the specified name does not start with a slash, and the file is not found in the current directory, several other directories are searched. First, any directories you have specified with the ‘-I’ or ‘--include-dir’ option are searched (see Summary of Options). Then the following directories (if they exist) are searched, in this order: prefix/include (normally /usr/local/include)/usr/gnu/include, /usr/local/include, /usr/include.
filenames can contain shell file name patterns. If filenames is empty, nothing is included and no error is printed. If the file names contain any variable or function references, they are expanded.
If you want
message, use the -include directive instead of include, like this:
-include filenames…
For compatibility with some other make implementations, sinclude is another name for -include.
====================================================================
Cited from 3.7 How make Reads a Makefile
make
to simply ignore a makefile which does not exist or cannot be remade, with no errormessage, use the -include directive instead of include, like this:
-include filenames…
For compatibility with some other make implementations, sinclude is another name for -include.
====================================================================
Cited from 3.7 How make Reads a Makefile
====================================================================
Cited from 3.8 Secondary ExpansionSunday, 21 June 2015
Creating Makefile from Json
In Python, aLib/webForm/json2make.py, and aLib package is described in aLib a sets of software tools to do basic analysis of Illumina sequencers
Json and jsvelocity utility for creating makefile, and separately, XML and XSL-based makefile creation pipeline are described in XML+XSLT = #Makefile -based #workflows for #bioinformatics
Json and jsvelocity utility for creating makefile, and separately, XML and XSL-based makefile creation pipeline are described in XML+XSLT = #Makefile -based #workflows for #bioinformatics
JSON Format
Excerpts from JSON Tutorial
"JSON is a syntax for storing and exchanging data.
JSON values can be:
"JSON is a syntax for storing and exchanging data.
JSON is language independent."
==============================================================
Excerpts from JSON Syntax
"JSON syntax is part of JavaScript syntax:
Excerpts from JSON Syntax
"JSON syntax is part of JavaScript syntax:
- Data is in name/value pairs
- Data is separated by commas
- Curly braces hold objects
- Square brackets hold arrays
JSON values can be:
- A number (integer or floating point)
- A string (in double quotes)
- A Boolean (true or false)
- An array (in square brackets)
- An object (in curly braces)
- null"
Saturday, 13 June 2015
Friday, 12 June 2015
Thursday, 11 June 2015
R biomaRt
Cited from The biomaRt user’s guide
- A first step is to check which BioMart web services are available. The function listMarts will display all available BioMart web services.
- The useMart function can now be used to connect to a specified BioMart database, this must be a valid name given by listMarts.
- BioMart databases can contain several datasets, for Ensembl every species is a different dataset. In a next step, the datasets are available in the selected BioMart database can be visualised by using the function listDatasets.
- To select a dataset we can up date the Mart object using the function useDataset. Or alternatively if the dataset one wants to use is known in advance, one can select a BioMart database and dataset in one step by useMart("database",dataset="dataset").
- The getBM function is the main query function in biomaRt. For some frequently used queries to Ensembl, wrapper functions are available: getGene and getSequence. biomaRt has four main arguments:
- attributes: is a vector of attributes that one wants to retrieve (= the output of the query).
- filters: is a vector of filters that one wil use as input to the query.
- values: a vector of values for the filters. In case multple filters are in use, the values argument requires a list of values where each position in the list corresponds to the position of the filters in the filters argument.
- mart: is and object of class Mart, which is created by the useMart function.
=============================================================
Monday, 8 June 2015
Sunday, 7 June 2015
Saturday, 6 June 2015
Thursday, 4 June 2015
R Color Cheatsheet
R color cheatsheet
Cheat Sheets for Plotting Symbols and Color Palettes (useful for color palette selection)
brewerpal
A guide to using colors in R
R Color Reference Sheet
Cheat Sheets for Plotting Symbols and Color Palettes (useful for color palette selection)
brewerpal
A guide to using colors in R
R Color Reference Sheet
Correlation Matrix Heatmap
ggplot2 : Quick correlation matrix heatmap
or
library(corrplot)
corrplot(corr, type="upper", order="hclust", tl.col="black", tl.srt=45)
or
library(corrplot)
corrplot(corr, type="upper", order="hclust", tl.col="black", tl.srt=45)
Subscribe to:
Posts (Atom)