Skip to content

Commit

Permalink
Handle windows newlines on input files
Browse files Browse the repository at this point in the history
  • Loading branch information
untergasser committed Nov 16, 2018
1 parent 745aba5 commit 2faf322
Show file tree
Hide file tree
Showing 4 changed files with 470 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libprimer3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7207,6 +7207,10 @@ p3_read_line(FILE *file)

if ((n = strchr(p, '\n')) != NULL) {
*n = '\0';
n--;
if (*n == '\r') {
*n = '\0';
}
return s;
}

Expand Down
2 changes: 2 additions & 0 deletions test/p3test.pl
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,8 @@ ()
'primer_new_tasks',
'primer_new_tasks_formatted',

'primer_windows_newlines',

'primer_must_overlap_point',
'primer_overlap_junction',

Expand Down
52 changes: 52 additions & 0 deletions test/primer_windows_newlines_input
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
PRIMER_THERMODYNAMIC_OLIGO_ALIGNMENT=1
PRIMER_TM_FORMULA=1
PRIMER_SALT_CORRECTIONS=1
PRIMER_SALT_DIVALENT=1.5
PRIMER_MAX_SELF_ANY=12
PRIMER_PAIR_MAX_COMPL_ANY=12
PRIMER_MAX_POLY_X=100
PRIMER_MAX_SELF_END=8
PRIMER_PAIR_MAX_COMPL_END=8
P3_FILE_FLAG=1
PRIMER_EXPLAIN_FLAG=1
PRIMER_TASK=pick_pcr_primers
PRIMER_DNTP_CONC=0.0
SEQUENCE_ID=pcr_primers
SEQUENCE_TEMPLATE=TCCTACAGCTGTGGGAAAATGatgcgtacgatccatgctagctagctactatcgattagctatcatctactatcatctactatctactacacatctactatcatctacacacacacacacactaggccgctatatcatctagcGCCGCCATGTACACACTG
SEQUENCE_TARGET=21,122
=
SEQUENCE_ID=pcr_primers_and_io
PRIMER_TASK=pick_pcr_primers_and_hyb_PROBE
SEQUENCE_TEMPLATE=NATCCANGCTGTTTCACACTTACGGAAATGGANGACTNCCCATAGCTNCTGGGCTNTTATCCAAAAAACATTCTCTNNNTGNTGCTTATTGGCNTCTCNAAGTGTGCNNACTTCATGGGCCTACACANAATTGNNCANGGGCTTAGCGTGCGTGGGGTCCCTNGGTAACATNGGCATCTCTGCACTTCNNGGTNNCCTTCCTTCTNACCAAGGGGTATCTGGNTGCCAGTGGCTTTTCTCCAACAGGAANGGGGGTATGTGCATTNGCAGACATCAATGANCATGAGAGATATNAATAGG
=
SEQUENCE_ID=left_only
PRIMER_TASK=pick_left_only
SEQUENCE_TARGET=100,20
SEQUENCE_TEMPLATE=GNATCTGCACCCTGTAAACCCTGGCTCCTGCCTCTCCGGGACACCCCACTGAGGTCAGCACACCCTGCAGGTTTAGAAGGGGTGTCTGGGTGCATTTGGTGACACCGCAGGCAGAGGGGGGACNCCACAGCCAGCTCTGCCCGCGGATGCCACGTCCATTTGCTTCAGCAGGATC
=
SEQUENCE_ID=right_only
PRIMER_TASK=PICK_right_only
SEQUENCE_TARGET=90,10
SEQUENCE_TEMPLATE=GANCAATGCANGTAATGANGTTGGCANAATTATGAATCGCAATCAAATTTTTTCTATGACCTGATAGAAACGCCAACTCACTGTATGAGTCTGTTGTCAAAGTCTAACTTCCAAAACGCAAAGCACGCTCCCGATC
=
SEQUENCE_ID=hyb_probe_only
PRIMER_TASK=pick_HYB_probe_ONly
SEQUENCE_INTERNAL_EXCLUDED_REGION=90,20
SEQUENCE_TEMPLATE=GCATCTGCACCCTGTAAACCCTGGCTCCTGCCTCTCCGGGACACCCCACTGAGGTCAGCACACCCTGCAGGTTTAGAAGGGGTGTCTGGGTGCATTTGGTGACACCGCAGGCAGAGGGGGGACNCCACAGCCAGCTCTGCCCGCGGATGCCACGTCCATTTGCTTCAGCAGGATC
=
SEQUENCE_ID=left_only
PRIMER_MIN_SIZE=20
PRIMER_MAX_SIZE=20
PRIMER_TASK=pick_left_only
SEQUENCE_TEMPLATE=TTAGAAGGGGTGTCTGGGTG
=
SEQUENCE_ID=right_only
PRIMER_TASK=pick_left_only
SEQUENCE_TEMPLATE=TTAGAAGGGGTGTCTGGGTG
=
SEQUENCE_ID=hyb_probe_only
PRIMER_INTERNAL_MIN_SIZE=20
PRIMER_INTERNAL_MAX_SIZE=20
PRIMER_TASK=pick_left_only
SEQUENCE_TEMPLATE=TTAGAAGGGGTGTCTGGGTG
=
Loading

0 comments on commit 2faf322

Please sign in to comment.