Skip to content

Commit

Permalink
transcript merge implemented (--merge option)
Browse files Browse the repository at this point in the history
  • Loading branch information
gpertea committed Jan 2, 2016
1 parent 6066694 commit 43df317
Show file tree
Hide file tree
Showing 12 changed files with 8,283 additions and 5,999 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ endif


BASEFLAGS := -Wall -Wextra ${SEARCHDIRS} $(MARCH) -D_FILE_OFFSET_BITS=64 \
-D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-exceptions -fno-rtti
-D_LARGEFILE_SOURCE -fno-strict-aliasing -fno-exceptions -fno-rtti -D_DARWIN_C_SOURCE

# C/C++ linker

Expand Down Expand Up @@ -103,7 +103,7 @@ endif



OBJS += rlink.o tablemaker.o
OBJS += rlink.o tablemaker.o tmerge.o

.PHONY : all debug clean cleanall cleanAll allclean release nothreads
all: stringtie
Expand All @@ -119,6 +119,7 @@ nothreads: stringtie
${GDIR}/GBam.o : $(GDIR)/GBam.h
stringtie.o : $(GDIR)/GBitVec.h $(GDIR)/GHash.hh $(GDIR)/GBam.h
rlink.o : rlink.h tablemaker.h $(GDIR)/GBam.h $(GDIR)/GBitVec.h
tmerge.o : rlink.h tmerge.h
tablemaker.o : tablemaker.h rlink.h
${BAM}/libbam.a:
cd ${BAM} && make lib
Expand Down
23 changes: 21 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ The following optional parameters can be specified (use -h/--help to get the
usage message):

--version : print current version at stdout
-h print this usage message
-G reference annotation to use for guiding the assembly process (GTF/GFF3)
-l name prefix for output transcripts (default: STRG)
-f minimum isoform fraction (default: 0.1)
Expand All @@ -65,6 +66,24 @@ usage message):
created under the directory path given as <dir_path>
-e only estimates the abundance of given reference transcripts (requires -G)
-x do not assemble any transcripts on the given reference sequence(s)
Transcript merge usage mode:
stringtie --merge [Options] { gtf_list | strg1.gtf ...}
With this option StringTie will assemble transcripts from multiple\n\
input files generating a unified non-redundant set of isoforms. In this\n\
usage mode the following options are available:\n\
-G <guide_gff> reference annotation to include in the merging (GTF/GFF3)\n\
-o <out_gtf> output file name for the merged transcripts GTF\n\
(default: stdout)\n\
-m <min_len> minimum input transcript length to include in the merge\n\
(default: 50)\n\
-c <min_cov> minimum input transcript coverage to include in the merge\n\
(default: 0)\n\
-F <min_fpkm> minimum input transcript FPKM to include in the merge\n\
(default: 0)\n\
-T <min_tpm> minimum input transcript TPM to include in the merge\n\
(default: 0)\n\
-f <min_iso> minimum isoform fraction (default: 0.01)\n\
-l <label> name prefix for output transcripts (default: MSTRG)\n\

Input files
-----------
Expand All @@ -74,9 +93,9 @@ This file contains spliced read alignments such as the ones produced by TopHat o
A text file in SAM format should be converted to BAM and sorted using the
samtools program:

samtools view -S -b input.sam | samtools sort - input.sorted
samtools view -Su alns.sam | samtools sort - alns.sorted

The file resulted from the above command (input.sorted.bam) can be used
The file resulted from the above command (alns.sorted.bam) can be used
directly as input to StringTie.

Any SAM spliced read alignment (a read alignment across at least one junction)
Expand Down
20 changes: 18 additions & 2 deletions gclib/GBase.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "GBase.h"
#include <stdarg.h>
#include <ctype.h>
#include <errno.h>

#ifndef S_ISDIR
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
Expand Down Expand Up @@ -188,7 +189,7 @@ int Gstrcmp(const char* a, const char* b, int n) {

}

int G_mkdir(const char* path, int perms=0775) {
int G_mkdir(const char* path, int perms=(S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH) ) {
#ifdef __WIN32__
return _mkdir(path);
#else
Expand All @@ -201,6 +202,18 @@ int G_mkdir(const char* path, int perms=0775) {
}


void Gmktempdir(char* templ) {
#ifdef __WIN32__
int blen=strlen(templ);
if (_mktemp_s(templ, blen)!=0)
GError("Error creating temp dir %s!\n", templ);
#else
char* cdir=mkdtemp(templ);
if (cdir==NULL)
GError("Error creating temp dir %s!\n", templ);
#endif
}

int Gmkdir(const char *path, bool recursive, int perms) {
if (path==NULL || path[0]==0) return -1;
if (!recursive) return G_mkdir(path, perms);
Expand All @@ -222,7 +235,10 @@ int Gmkdir(const char *path, bool recursive, int perms) {
*psep=0; //now gpath is the path up to this /
ss=psep; ++ss; //ss repositioned just after the /
// create current level
if (fileExists(gpath)!=1 && G_mkdir(gpath, perms)!=0) {
int mkdir_err=0;
if (fileExists(gpath)!=1 && (mkdir_err=G_mkdir(gpath, perms))!=0 ) {
if (mkdir_err!=0)
GMessage("Warning: failed at mkdir(%s): %s\n",gpath,strerror(errno));
GFREE(gpath);
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion gclib/GBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ inline int iround(double x) {
}

int Gmkdir(const char *path, bool recursive=true, int perms=0775);

void Gmktempdir(char* templ);

/****************************************************************************/

Expand Down
Loading

0 comments on commit 43df317

Please sign in to comment.