Sunday 28 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."

Parse a BAM File Using Perl

How to parse a BAM file using Perl

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"

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.

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.

A directive is an instruction for make to do something special while reading the makefile. These include:
====================================================================
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

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:

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.

If you want make to simply ignore a makefile which does not exist or cannot be remade, with no error
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

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.

====================================================================
Cited from 3.8 Secondary Expansion

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.


Makefile Assignment Operators

The variants of GNU Makefile assignment operators

Export Parameters to Makefile

Passing additional variables from command line to make

The Basics: Getting environment variables into GNU Make

Sunday 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


GitHub md File

What file uses .md extension and how should I edit them?

JSON Format

Excerpts from JSON Tutorial

"JSON is a syntax for storing and exchanging data.
JSON is language independent."

==============================================================
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 data is written as name/value pairs. A name/value pair consists of a field name (in double quotes), followed by a colon, followed by a value."

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"

Bash: Make and Makefile

The Makefile

Bash: Configuration Files in Shell Scripting

Using Configuration Files With Shell Scripts

Thursday 11 June 2015

Conversion Between Objects of GRanges, RangedData, RangesList, RleList or RleViewsList Classes

GRanges objects

Retrieve Archived Ensembl Dataset Using R biomaRt

biomaRt: load archived Ensembl Genes database anymore

Peak Annotation With biomaRt using Chippeakanno

Custom Annotation With Chippeakanno

ChIPpeakAnno Biomart annotation

ChIPpeakAnno Analysis Pipeline

R biomaRt

Cited from The biomaRt user’s guide

  1. A first step is to check which BioMart web services are available. The function listMarts will display all available BioMart web services.
  2. The useMart function can now be used to connect to a specified BioMart database, this must be a valid name given by listMarts.
  3. 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.
  4. To select a dataset we can up date the Mart object using the function useDataset.
  5. 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").
  6. 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.
=============================================================