Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcunial committed Aug 25, 2023
1 parent 9551230 commit d3630a9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
5 changes: 5 additions & 0 deletions scripts/6-repeatAlphabet/1-buildAlphabet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,15 @@ while [ ${ITER} -le ${TANDEM_SPACERS_ITERATIONS} ]; do
mv ${READS_TRANSLATED_FILE} ${READS_TRANSLATED_FILE}-preTspacers
mv ${READS_TRANSLATED_BOUNDARIES} ${READS_TRANSLATED_BOUNDARIES}-preTspacers
mv ${ALPHABET_FILE} ${ALPHABET_FILE}-preTspacers
mv ${FULLY_UNIQUE_FILE} ${FULLY_UNIQUE_FILE}-preTspacers
for THREAD in $(seq 0 ${TO}); do
cat ${TMPFILE_PATH}-tspacers-12-${THREAD}.txt >> ${READS_TRANSLATED_FILE}
cat ${TMPFILE_PATH}-tspacers-13-${THREAD}.txt >> ${READS_TRANSLATED_BOUNDARIES}
done
touch ${FULLY_UNIQUE_FILE}
for i in $(sed -n '/^$/=' ${READS_TRANSLATED_FILE}); do
echo $(( $i - 1 )) >> ${FULLY_UNIQUE_FILE}
done
mv ${ALPHABET_FILE_SPACERS} ${ALPHABET_FILE}
TANDEM_SPACERS_FIXED="1"
echo "Tandem spacers fixed"
Expand Down
18 changes: 9 additions & 9 deletions src/de/mpi_cbg/revant/apps/BuildAssemblyGraph.java
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public static void main(String[] args) throws IOException {
componentSize = new int[nComponents];
Math.set(componentSize,nComponents-1,0);
for (i=0; i<N_READS; i++) componentSize[component[i]]++;
printHistogram(componentSize,nComponents);
printHistogram(componentSize,nComponents,N_READS);
j=-1;
for (i=0; i<nComponents; i++) {
if (componentSize[i]>=MIN_COMPONENT_SIZE) componentSize[++j]=i;
Expand Down Expand Up @@ -279,7 +279,7 @@ public static void main(String[] args) throws IOException {
componentSize = new int[nComponents];
Math.set(componentSize,nComponents-1,0);
for (i=0; i<N_READS; i++) componentSize[component[i]]++;
printHistogram(componentSize,nComponents);
printHistogram(componentSize,nComponents,N_READS);
j=-1;
for (i=0; i<nComponents; i++) {
if (componentSize[i]>=MIN_COMPONENT_SIZE) componentSize[++j]=i;
Expand Down Expand Up @@ -317,21 +317,21 @@ public static void main(String[] args) throws IOException {
}


private static final void printHistogram(int[] componentSize, int nComponents) {
private static final void printHistogram(int[] componentSize, int nComponents, int nNodes) {
int i;
double count;
int[] tmpArray;

System.err.println("Cumulative distribution of component size:");
System.err.println("Number of nodes in components of size >=:");
tmpArray = new int[nComponents];
System.arraycopy(componentSize,0,tmpArray,0,nComponents);
Arrays.sort(tmpArray);
count=1.0;
for (i=1; i<nComponents; i++) {
if (tmpArray[i]!=tmpArray[i-1]) System.err.println(tmpArray[i-1]+","+(count/nComponents));
count++;
count=tmpArray[nComponents-1];
for (i=nComponents-2; i>=0; i--) {
if (tmpArray[i]!=tmpArray[i+1]) System.err.println(tmpArray[i+1]+","+(count/nNodes));
count+=tmpArray[i];
}
System.err.println(tmpArray[nComponents-1]+",1");
System.err.println(tmpArray[0]+","+(count/nNodes));
}


Expand Down
8 changes: 4 additions & 4 deletions src/de/mpi_cbg/revant/apps/FixTandemSpacers1.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@ public static void main(String[] args) throws IOException {


for (int x=0; x<=RepeatAlphabet.lastSpacer; x++) {
if (RepeatAlphabet.spacers[x].read==42) System.err.println("VITTU> 1 "+RepeatAlphabet.spacers[x]);
if (RepeatAlphabet.spacers[x].read==767) System.err.println("VITTU> 1 "+RepeatAlphabet.spacers[x]);
}

RepeatAlphabet.loadTandemSpacers_blocks(READ_READ_ALIGNMENTS_FILE,DISTANCE_THRESHOLD,LONG_SPACER_LENGTH,NONREPETITIVE_BLOCKS_MODE,tmpArray);


for (int x=0; x<=RepeatAlphabet.lastSpacer; x++) {
if (RepeatAlphabet.spacers[x].read==42) System.err.println("VITTU> 2 "+RepeatAlphabet.spacers[x]);
if (RepeatAlphabet.spacers[x].read==767) System.err.println("VITTU> 2 "+RepeatAlphabet.spacers[x]);
}


Expand All @@ -71,15 +71,15 @@ public static void main(String[] args) throws IOException {


for (int x=0; x<=RepeatAlphabet.lastSpacer; x++) {
if (RepeatAlphabet.spacers[x].read==42) System.err.println("VITTU> 3 "+RepeatAlphabet.spacers[x]+" lastSpacerNeighbor="+RepeatAlphabet.lastSpacerNeighbor[x]);
if (RepeatAlphabet.spacers[x].read==767) System.err.println("VITTU> 3 "+RepeatAlphabet.spacers[x]+" lastSpacerNeighbor="+RepeatAlphabet.lastSpacerNeighbor[x]);
}



if (!RepeatAlphabet.propagateSolutions(DISTANCE_THRESHOLD_CONSISTENCY)) { System.out.println("3"); return; }

for (int x=0; x<=RepeatAlphabet.lastSpacer; x++) {
if (RepeatAlphabet.spacers[x].read==42) System.err.println("VITTU> 4 "+RepeatAlphabet.spacers[x]);
if (RepeatAlphabet.spacers[x].read==767) System.err.println("VITTU> 4 "+RepeatAlphabet.spacers[x]);
}


Expand Down
5 changes: 3 additions & 2 deletions src/de/mpi_cbg/revant/apps/RepeatAlphabet.java
Original file line number Diff line number Diff line change
Expand Up @@ -10138,8 +10138,9 @@ public static final void wobble_buildOld2New(Character[] alphabet_old, int lastA
* Remark: wobbling is designed to increase the number of edges in a highly
* disconnected overlap graph where the endpoints of repeat occurrences are uncertain.
* However, such increase in frequency may make some k-mers be classified as repeats
* rather than as unique addresses on the genome, and this might \emph{remove} some
* edges from the overlap graph.
* rather than as unique addresses in the genome, and this might \emph{remove} some
* edges from the overlap graph (of course it might also make rare noisy k-mers become
* frequent enough to be considered unique addresses in the genome).
*
* Remark: this procedure might put multiple unique characters inside a block that
* contains a single unique character. Thus, throughout the code, no test for the
Expand Down

0 comments on commit d3630a9

Please sign in to comment.