2c2
<  # Copyright (c) 2012, Moitrayee Bhattacharyya, Kallol Gupta, P. Balaram, Indian Institute of Science, Bangalore, India
---
>  # Copyright (c) 2012, Moitrayee Bhattacharyya, Kallol Gupta, P. Balaram, Indian Institute of Science, Bangalore, India.
13c13
<  # (3) Neither the name of the Indian Institute of Science, Bangalore, India
---
>  # (3) Neither the name of the Indian Institute of Science, Bangalore, India 
30d29
< 
39c38
< use constant COMBINATION_EXE => 'comb_win';
---
> use constant COMBINATION_EXE => './comb';
101a101,104
> my @off1 = ();
> my @off2 = ();
> my %offset1 = ();
> my %offset2 = ();
106a110
> my $neg_seq = 0;
107a112
> # Parse arguments and assign to variables
120a126
> # Open the fil_pep_cys.out (contains string of characters in every line, which are to be combined) 
123a130,132
> # Parse the file and gather all the information in it in the arrays
> # File format - 3 columns:
> #    <string contains peptides sequence>    <mass of peptide sequence>     <number of cystines>
126,128c135,140
< 	chomp $line;
< 	my @flds = trim split(/\s+/, $line);
< 	push @peptides , uc $flds[0] if( @flds && scalar @flds > 1 && $flds[0] =~ /^[A-Z]+$/i);
---
>  	# remove new lines, spaces, etc. from the end
> 	chomp $line;     
> 	my @flds = trim split(/\s+/, $line); 
> 
> 	# Add the  
> 	push @peptides, uc $flds[0] if( @flds && scalar @flds > 1 && $flds[0] =~ /^[A-Z]+$/i);
130a143,144
> 	push @off1, $flds[3] if ( @flds && scalar @flds > 1 );
> 	push @off2, $flds[4] if ( @flds && scalar @flds > 1 );
132a147,150
> 
> 
> # Assign unique tag to each peptide sequence and insert them into hashtables
> #print "Assigning unique tags and splitting with '$new_delim'\n";
135a154
>     #  	print "\tTAG: $tag\n";
139c158,162
< #	print "$peptide_m{$tag}\n";
---
> 	$offset1{$tag} = $off1[$i];
> 	$offset2{$tag} = $off2[$i];
> #	print "\t\tpeptide_map\{\$tag\} = $peptide_map{$tag}\n";
> 
> 	# Split the sequence into individual peptides and put them into a second level map
144c167
< #		print $_,"\n";
---
> #		print "\t\t\tsplit = $_\n";
148a172
> # For each peptide sequence  
155c179,185
< 		foreach my $str ( keys %{ $conflict_list{$tag_i} } )
---
> 		my ($start_offset_i, $start_offset_j, $end_offset_i, $end_offset_j);
> 		$start_offset_i = $offset1{$tag_i};
> 		$start_offset_j = $offset1{$tag_j};
> 		$end_offset_i = $offset2{$tag_i};
> 		$end_offset_j = $offset2{$tag_j};
> 
> 		if ( ($start_offset_j >= $start_offset_i && $start_offset_j <= $end_offset_i) || ($start_offset_i >= $start_offset_j && $start_offset_i <= $end_offset_j)) 
157,161c187,196
< 			if( $peptide_map{$tag_j} =~ /^$str/ )
< 			{
< 				$conflict_map{$tag_i}{$tag_j} = 1;
< 			}
< 		}
---
> 			$conflict_map{$tag_i}{$tag_j} = 1;
> 		}	
> 			
> 		# foreach my $str ( keys %{ $conflict_list{$tag_i} } )
> 		#{
> 		#	if( $peptide_map{$tag_j} =~ /^$str/ )
> 		#	{
> 		#		$conflict_map{$tag_i}{$tag_j} = 1;
> 		#	}
> 		#}
190c225,226
< #print "$sstr\n";
---
> 
> $tuple=$#bag+1;
200a237
> 
203c240
< #		print $str,"\n"; 
---
> 	#	print $str,"\n"; 
