Skip to content

Commit

Permalink
Additional tests performed. User manual updated. Version incremented.
Browse files Browse the repository at this point in the history
  • Loading branch information
izhbannikov committed Dec 12, 2017
1 parent c1a5f05 commit 9d00366
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 82 deletions.
46 changes: 23 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ BIN = bin/
OBJ = obj/
LIBRARY := ${OBJ}lgzstream.a
PLATFORM = -DAPPLE
OPT=-O
OPT=-O3
#GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
#GCCVERSION = $(shell g++ -dumpversion)

Expand Down Expand Up @@ -88,84 +88,84 @@ ifeq ($(PLATFORM),-DAPPLE)

gzstream.o : $(SRC)gzstream.C $(SRC)gzstream.h
#$(CXX) -I $(SRC) -O -Wall -c -o $(OBJ)gzstream.o $(SRC)gzstream.C
gcc -I $(SRC) -O -Wall -c -o $(OBJ)gzstream.o $(SRC)gzstream.C
gcc -I $(SRC) $(OPT) -Wall -c -o $(OBJ)gzstream.o $(SRC)gzstream.C

else

all: mkobj mkbin gzstream.o libgzstream.a abi.o poly.o sff.o sffreader.o ascii.o util.o Read.o QualTrim.o Report.o iz_SSAHA.o pairwise.o Dictionary.o KMerRoutine.o MainPipeLine.o Illumina.o Roche.o dup.o flash.o main.o seqyclean

#
seqyclean : $(OBJ)main.o $(OBJ)flash.o $(OBJ)dup.o $(OBJ)Roche.o $(OBJ)Illumina.o $(OBJ)MainPipeLine.o $(OBJ)KMerRoutine.o $(OBJ)Dictionary.o $(OBJ)pairwise.o $(OBJ)iz_SSAHA.o $(OBJ)Report.o $(OBJ)QualTrim.o $(OBJ)sffreader.o $(OBJ)Read.o $(OBJ)util.o $(OBJ)ascii.o $(OBJ)sffreader.o $(OBJ)sff.o $(OBJ)abi.o $(OBJ)gzstream.o
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -o $(BIN)seqyclean $(OBJ)main.o $(OBJ)flash.o $(OBJ)dup.o $(OBJ)Roche.o $(OBJ)Illumina.o $(OBJ)MainPipeLine.o $(OBJ)KMerRoutine.o $(OBJ)Dictionary.o $(OBJ)pairwise.o $(OBJ)iz_SSAHA.o $(OBJ)Report.o $(OBJ)QualTrim.o $(OBJ)Read.o $(OBJ)util.o $(OBJ)ascii.o $(OBJ)sffreader.o $(OBJ)sff.o $(OBJ)poly.o $(OBJ)abi.o $(OBJ)gzstream.o -I$(LIBRARY) -lpthread -lz
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -o $(BIN)seqyclean $(OBJ)main.o $(OBJ)flash.o $(OBJ)dup.o $(OBJ)Roche.o $(OBJ)Illumina.o $(OBJ)MainPipeLine.o $(OBJ)KMerRoutine.o $(OBJ)Dictionary.o $(OBJ)pairwise.o $(OBJ)iz_SSAHA.o $(OBJ)Report.o $(OBJ)QualTrim.o $(OBJ)Read.o $(OBJ)util.o $(OBJ)ascii.o $(OBJ)sffreader.o $(OBJ)sff.o $(OBJ)poly.o $(OBJ)abi.o $(OBJ)gzstream.o -I$(LIBRARY) -lpthread -lz

main.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)main.o $(SRC)main.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)main.o $(SRC)main.cpp

flash.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)flash.o $(SRC)flash.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)flash.o $(SRC)flash.cpp

dup.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)dup.o $(SRC)dup.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)dup.o $(SRC)dup.cpp

Roche.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)Roche.o $(SRC)Roche_lin.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)Roche.o $(SRC)Roche_lin.cpp

Illumina.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)Illumina.o $(SRC)Illumina_retro_compiler.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)Illumina.o $(SRC)Illumina_retro_compiler.cpp
#if [ "$(GCCVERSION)" > "4.2" ] ; then \
# $(CXX) $(CFLAGS) -O3 -c -o $(OBJ)Illumina.o $(SRC)Illumina.cpp;\
#else \
# $(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)Illumina.o $(SRC)Illumina_retro_compiler.cpp ;\
#fi

MainPipeLine.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)MainPipeLine.o $(SRC)MainPipeLine.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)MainPipeLine.o $(SRC)MainPipeLine.cpp

KMerRoutine.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)KMerRoutine.o $(SRC)KMerRoutine.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)KMerRoutine.o $(SRC)KMerRoutine.cpp

Dictionary.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)Dictionary.o $(SRC)Dictionary.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)Dictionary.o $(SRC)Dictionary.cpp

pairwise.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)pairwise.o $(SRC)pairwise.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)pairwise.o $(SRC)pairwise.cpp

iz_SSAHA.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)iz_SSAHA.o $(SRC)iz_SSAHA.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)iz_SSAHA.o $(SRC)iz_SSAHA.cpp

Report.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)Report.o $(SRC)Report.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)Report.o $(SRC)Report.cpp

QualTrim.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)QualTrim.o $(SRC)QualTrim.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)QualTrim.o $(SRC)QualTrim.cpp

Read.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)Read.o $(SRC)Read.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)Read.o $(SRC)Read.cpp

util.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)util.o $(SRC)util.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)util.o $(SRC)util.cpp

ascii.o :
$(CXX) $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)ascii.o $(SRC)ascii.cpp
$(CXX) $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)ascii.o $(SRC)ascii.cpp

sffreader.o: $(SRC)sffreader_lin.cpp $(SRC)sff_lin.h
g++ $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)sffreader.o $(SRC)sffreader_lin.cpp
g++ $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)sffreader.o $(SRC)sffreader_lin.cpp

sff.o:
g++ $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)sff.o $(SRC)sff_lin.c
g++ $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)sff.o $(SRC)sff_lin.c

poly.o:
g++ $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)poly.o $(SRC)poly.c
g++ $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)poly.o $(SRC)poly.c

abi.o:
g++ $(CFLAGS) ${PLATFORM} -O3 -c -o $(OBJ)abi.o $(SRC)abi.c
g++ $(CFLAGS) ${PLATFORM} $(OPT) -c -o $(OBJ)abi.o $(SRC)abi.c

libgzstream.a : $(OBJ)gzstream.o $(SRC)gzstream.h
${AR} $(OBJ)libgzstream.a $(OBJ)gzstream.o

gzstream.o : $(SRC)gzstream.C $(SRC)gzstream.h
#$(CXX) -I $(SRC) -O -Wall -c -o $(OBJ)gzstream.o $(SRC)gzstream.C
gcc -I $(SRC) -O -Wall -c -o $(OBJ)gzstream.o $(SRC)gzstream.C
gcc -I $(SRC) $(OPT) -Wall -c -o $(OBJ)gzstream.o $(SRC)gzstream.C


endif
Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions nbproject/private/private.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<file>file:/Users/ilya/Projects/seqyclean/src/Illumina_retro_compiler.cpp</file>
<file>file:/Users/ilya/Projects/seqyclean/src/Illumina.h</file>
<file>file:/Users/ilya/Projects/seqyclean/src/flash.cpp</file>
<file>file:/Users/ilya/Projects/seqyclean/Makefile</file>
</group>
</open-files>
</project-private>
91 changes: 32 additions & 59 deletions src/Illumina_retro_compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,14 @@ void IlluminaDynamic()
avg_trim_len_pe1 = (avg_trim_len_pe1*pe_accept_cnt + read1->read.length())/(pe_accept_cnt+1);
avg_trim_len_pe2 = (avg_trim_len_pe2*pe_accept_cnt + read2->read.length())/(pe_accept_cnt+1);

if (!shuffle_flag) {
avg_right_trim_len_pe1 = (avg_right_trim_len_pe1*cnt_right_trim_pe1 + cur_rclip_pe1)/(cnt_right_trim_pe1+1);
avg_left_trim_len_pe1 = (avg_left_trim_len_pe1*cnt_left_trim_pe1 + cur_lclip_pe1)/(cnt_left_trim_pe1+1);

avg_right_trim_len_pe2 = (avg_right_trim_len_pe2*cnt_right_trim_pe2 + cur_rclip_pe2)/(cnt_right_trim_pe2+1);
avg_left_trim_len_pe2 = (avg_left_trim_len_pe2*cnt_left_trim_pe2 + cur_lclip_pe2)/(cnt_left_trim_pe2+1);

if (!shuffle_flag)
{
if(compressed_output)
{
WritePEFileGZ(pe_output_file1_gz, read1);
Expand All @@ -369,7 +376,8 @@ void IlluminaDynamic()
pe_bases_kept += static_cast<long long>(read1->read.length());
pe_bases_kept += static_cast<long long>(read2->read.length());

} else {
} else
{
if(compressed_output)
{
WriteShuffleFileGZ( shuffle_file_gz, read1, read2 );
Expand All @@ -384,9 +392,17 @@ void IlluminaDynamic()

}
pe_accept_cnt+=1;
cnt_right_trim_pe1 += 1;cnt_left_trim_pe1 += 1;
cnt_right_trim_pe2 += 1;cnt_left_trim_pe2 += 1;

} else if ((read1->discarded == 0) && (read2->discarded == 1))
{
avg_trim_len_pe1 = (avg_trim_len_pe1*pe_accept_cnt + read1->read.length())/(pe_accept_cnt+1);

avg_right_trim_len_pe1 = (avg_right_trim_len_pe1*cnt_right_trim_pe1 + cur_rclip_pe1)/(cnt_right_trim_pe1+1);
avg_left_trim_len_pe1 = (avg_left_trim_len_pe1*cnt_left_trim_pe1 + cur_lclip_pe1)/(cnt_left_trim_pe1+1);


if( new2old_illumina && !old_style_illumina_flag ) //if convert to old-style illumina headers is true and not old illumina files.
read1->illumina_readID = read1->illumina_readID.substr(0,read1->illumina_readID.length()-2);

Expand All @@ -401,9 +417,15 @@ void IlluminaDynamic()

se_pe1_accept_cnt+=1;
se_pe1_bases_kept += read1->read.length();
cnt_right_trim_pe1 += 1;cnt_left_trim_pe1 += 1;

} else if( (read1->discarded == 1) && (read2->discarded == 0) )
{
avg_trim_len_pe2 = (avg_trim_len_pe2*pe_accept_cnt + read2->read.length())/(pe_accept_cnt+1);

avg_right_trim_len_pe2 = (avg_right_trim_len_pe2*cnt_right_trim_pe2 + cur_rclip_pe2)/(cnt_right_trim_pe2+1);
avg_left_trim_len_pe2 = (avg_left_trim_len_pe2*cnt_left_trim_pe2 + cur_lclip_pe2)/(cnt_left_trim_pe2+1);

if( new2old_illumina && !old_style_illumina_flag ) //if convert to old-style illumina headers is true and not old illumina files.
read2->illumina_readID = read2->illumina_readID.substr(0,read2->illumina_readID.length()-3);

Expand All @@ -418,7 +440,7 @@ void IlluminaDynamic()

se_pe2_accept_cnt +=1;
se_pe2_bases_kept += read2->read.length();

cnt_right_trim_pe2 += 1;cnt_left_trim_pe2 += 1;
}

update_counters_and_print_statistics(read1, read2);
Expand Down Expand Up @@ -1403,66 +1425,24 @@ int TrimIlluminaSE(Read* read, bool trim_adapter)
// Adapter firsts then quality trimming goes second
int TrimAdapterSE(Read* read) {
bool adapter_found = false;
//First 15 bases of i5 adapter forward
//size_t found;

/*std::string ts_adapter = tmpl_i5_1.substr(0,15);*/
//First 15 bases of i5 adapter forward
std::string query_str = tmpl_i5_1.substr(0,15);
adapter_found = align_ssaha(read, query_str );
///found = read->read.find(ts_adapter);
//if( found != std::string::npos )
if(adapter_found)
{
//std::cout << "i5 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << read->tru_sec_pos << endl;
//sum_stat << "i5 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << read->tru_sec_pos << endl;
//read->tru_sec_pos = found;
//read->tru_sec_found = 1;
}else
{
//First 20 bases of i5 adapter in reverse complement
//ts_adapter = MakeRevComplement(tmpl_i5_2).substr(0,15);
//found = read->read.find( ts_adapter );
if(!adapter_found)
{
query_str = MakeRevComplement(tmpl_i5_2).substr(0,15);
adapter_found = align_ssaha(read, query_str );
//if( found != string::npos )
if(adapter_found)
{
//std::cout << "i5 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << read->tru_sec_pos << endl;
//sum_stat << "i5 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << found->tru_sec_pos << endl;
//adapter_found = true;
//read->tru_sec_pos = found;
//read->tru_sec_found = 1;
} else

if(!adapter_found)
{
//First 20 bases of i7 adapter forward
//ts_adapter = tmpl_i7_1.substr(0,15);
//found = read->read.find( ts_adapter );
//if( found != std::string::npos )
query_str = tmpl_i7_1.substr(0,15);
adapter_found = align_ssaha(read, query_str );
if(adapter_found)
{
//std::cout << "i7 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << found << endl;
//sum_stat << "i7 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << found << endl;
//adapter_found = true;
//read->tru_sec_pos = found;
//read->tru_sec_found = 1;
} else
if(!adapter_found)
{
//First 20 bases of i5 adapter in reverse complement
//ts_adapter = MakeRevComplement(tmpl_i7_2).substr(0,15);
//found = read->read.find( ts_adapter );
//if( found != std::string::npos )
query_str = MakeRevComplement(tmpl_i7_2).substr(0,15);
adapter_found = align_ssaha(read, query_str );
if(adapter_found)
{
//std::cout << "i7 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << found << endl;
//sum_stat << "i7 adapter in forward first found in the read " << read->illumina_readID << ", in the position: " << found << endl;
//adapter_found = true;
//read->tru_sec_pos = found;
//read->tru_sec_found = 1;
} else
if(!adapter_found)
{
read->tru_sec_pos = -1;
read->tru_sec_found = 0;
Expand Down Expand Up @@ -1690,14 +1670,7 @@ int TrimIllumina(Read* read1, Read* read2)
cur_lclip_pe2 = 0.0;
}

avg_right_trim_len_pe1 = (avg_right_trim_len_pe1*cnt_right_trim_pe1 + cur_rclip_pe1)/(cnt_right_trim_pe1+1);
avg_left_trim_len_pe1 = (avg_left_trim_len_pe1*cnt_left_trim_pe1 + cur_lclip_pe1)/(cnt_left_trim_pe1+1);

avg_right_trim_len_pe2 = (avg_right_trim_len_pe2*cnt_right_trim_pe2 + cur_rclip_pe2)/(cnt_right_trim_pe2+1);
avg_left_trim_len_pe2 = (avg_left_trim_len_pe2*cnt_left_trim_pe2 + cur_lclip_pe2)/(cnt_left_trim_pe2+1);

cnt_right_trim_pe1 += 1;cnt_left_trim_pe1 += 1;
cnt_right_trim_pe2 += 1;cnt_left_trim_pe2 += 1;

return 0;
}
Expand Down

0 comments on commit 9d00366

Please sign in to comment.