ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/gclib/gclib/GFastaIndex.cpp
(Generate patch)
# Line 1 | Line 1
1   /*
2 < * GFaIdx.cpp
2 > * GFastaIndex.cpp
3   *
4   *  Created on: Aug 25, 2010
5   *      Author: gpertea
# Line 22 | Line 22
22           records.Add(seqname,farec);
23           farec->seqname=records.getLastKey();
24           }
25 <     }
25 > }
26  
27   int GFastaIndex::loadIndex(const char* finame) { //load record info from existing fasta index
28      if (finame==NULL) finame=fai_name;
# Line 47 | Line 47
47        p++;
48        uint len=0;
49        int line_len=0, line_blen=0;
50 <      #ifdef __WIN32__
50 > #ifdef __WIN32__
51           long offset=-1;
52           sscanf(p, "%d%ld%d%d", &len, &offset, &line_len, &line_blen);
53 <      #else
53 > #else
54           long long offset=-1;
55           sscanf(p, "%d%lld%d%d", &len, &offset, &line_len, &line_blen);
56 <      #endif
56 > #endif
57        if (len==0 || line_len==0 || line_blen==0 || line_blen<line_len)
58            GError(ERR_FAIDXLINE,p);
59        addRecord(s,len,offset,line_len, line_blen);
# Line 61 | Line 61
61      fclose(fi);
62      haveFai=(records.Count()>0);
63      return records.Count();
64 <    }
64 > }
65  
66   int GFastaIndex::buildIndex() {
67      //this parses the whole fasta file, so it could be slow
# Line 128 | Line 128
128      GFREE(seqname);
129      fclose(fa);
130      return records.Count();
131 <    }
131 > }
132  
133  
134   int GFastaIndex::storeIndex(const char* finame) { //write the hash to a file
# Line 140 | Line 140
140      GFREE(fai_name);
141      fai_name=Gstrdup(finame);
142      return rcount;
143 <    }
143 > }
144  
145   int GFastaIndex::storeIndex(FILE* fai) {
146    int rcount=0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines