Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
khalid
CroCoTest
Commits
95a7ca66
Commit
95a7ca66
authored
May 18, 2018
by
psimion
Browse files
last changes : conf.file now works
parent
18430303
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/CroCo_v1.2.sh
View file @
95a7ca66
...
...
@@ -84,15 +84,6 @@ else
exit
1
fi
### TESTS
echo
"fasta_array:"
echo
"
${
!fasta_array[@]
}
"
echo
echo
"orders:"
echo
"
${
orders
[@]
}
"
echo
###
### detecting suspect transcripts with BLAST
#source "$my_dir/detect_suspect_trans_with_blast.sh"
...
...
@@ -115,7 +106,10 @@ echo
esac
echo
-e
"
\n
Index built :
$out
/
$toolidx
\n
"
#for (( j=0; j <i; j++ ))
### preparing contigs files with transcripts length
refseqALL
=
$out
/ALL_transcripts.ctgs
touch
$refseqALL
for
ref
in
"
${
orders
[@]
}
"
do
refseqs
=
$out
/
$ref
".ctgs"
...
...
@@ -128,24 +122,23 @@ echo
Seqlength = length($2) ;
print a[1]"\t"Seqlength > refseqs
}'
$out
/
$ref
".fasta_mod"
# regroup all samples
echo
-e
"command to create ALL_transcripts.ctgs :
\t
cat
$refseqs
>>
$refseqALL
"
cat
$refseqs
>>
$refseqALL
done
# regroup all samples
refseqALL
=
$out
/ALL_transcripts.ctgs
cat
$out
/
$ref
.ctgs
>
$refseqALL
# mapping successively every read sets on all transcripts.
#for (( k=0; k <i; k++ ))
for
ref
in
"
${
orders
[@]
}
"
do
InfosCtg
=
${
fasta_array
[
$ref
]
}
#reads=${fasta_array[$k]}"_reads"
#fileout=$out/${fasta_array[$k]}"_vs_ALL.out"
reads
=
${
ref
}
"_reads"
fileout
=
$out
/
${
ref
}
"_vs_ALL.out"
finalout
=
$out
/
"ALL_transcripts.all"
#echo -e "\nMapping ${fasta_array[$k]} reads"
echo
-e
"
\n
Mapping
${
ref
}
reads"
echo
-e
"
\n
Info Contigs :
\t
$InfosCtg
\n
Outfile :
\t
$fileout
\n
"
#echo -e "\nInfo Contigs :\t$InfosCtg\nInfo Contigs detailed :\t${InfosCtg[0]};${InfosCtg[1]};${InfosCtg[2]} \
# \nfastq files :\t`echo $InfosCtg | cut -d';' -f2`\t`echo $InfosCtg | cut -d';' -f3` \
# \nOutfile :\t$fileout\nrefseqALL :\t$refseqALL\n"
# calculate expression level with selected tool
case
"
$TOOL
"
in
...
...
@@ -185,11 +178,15 @@ echo
R
)
if
[
$MODE
==
"u"
]
then
#fastq=" -r "$INDIR"/"${fasta_array[$k]}".fastq"
fastq
=
" -r "
$INDIR
"/"
$
{
InfosCtg
[1]
}
fastq
=
" -r "
$INDIR
"/"
`
echo
$InfosCtg
|
cut
-d
';'
-f2
`
else
#fastq=" -1 "$INDIR"/"${fasta_array[$k]}".L.fastq -2 "$INDIR"/"${fasta_array[$k]}".R.fastq"
fastq
=
" -1 "
$INDIR
"/"
$
{
InfosCtg
[1]
}
" -2 "
$INDIR
"/"
$
{
InfosCtg
[2]
}
fastq
=
" -1 "
$INDIR
"/"
`
echo
$InfosCtg
|
cut
-d
';'
-f2
`
" -2 "
$INDIR
"/"
`
echo
$InfosCtg
|
cut
-d
';'
-f3
`
fi
echo
-e
"rapmap quasimap -t
$PROCESSORS
$ADDOPT
-i
$out
/
$toolidx
$fastq
| grep -v "
@
" | cut -f3 |
\
awk -v reads=
$reads
-v refseqs=
$refseqALL
-AWKPART- >
$fileout
\n
"
rapmap quasimap
-t
$PROCESSORS
$ADDOPT
-i
$out
/
$toolidx
$fastq
|
grep
-v
"@"
|
cut
-f3
|
\
awk
-v
reads
=
$reads
-v
refseqs
=
$refseqALL
'BEGIN{OFS="\t"; while ((getline sequ < refseqs) > 0) {split(sequ,a,"\t");ctg[a[1]] = 0; ctgsize[a[1]]= a[2];}; close(refseqs) } {ctg[$1]++}
END{
...
...
@@ -216,6 +213,7 @@ echo
# splitting "All_transcript.all" file into files corresponding to samples
#for (( j=0; j <i; j++ ))
j
=
0
for
ref
in
"
${
orders
[@]
}
"
do
#ref=${fasta_array[$j]}
...
...
@@ -256,6 +254,7 @@ echo
LC_ALL
=
C
grep
-F
-w
-m
$nb
-f
$out
/
$ref
.suspects
$out
/
$ref
.all
>>
$out
/
$ref
".all_suspectonly"
mv
$out
/
$ref
".all"
$out
/
$ref
".all_quants"
;
mv
$out
/
$ref
".all_suspectonly"
$out
/
$ref
".all"
sed
-i
's/ /\t/g'
$out
/
$ref
".all"
j
=
$((
j+1
))
done
# http://www.inmotionhosting.com/support/website/ssh/speed-up-grep-searches-with-lc-all
...
...
src/CroCo_v1.2.sh~
View file @
95a7ca66
...
...
@@ -84,15 +84,6 @@ else
exit
1
fi
### TESTS
echo
"fasta_array:"
echo
"
${
!fasta_array[@]
}
"
echo
echo
"orders:"
echo
"
${
orders
[@]
}
"
echo
###
### detecting suspect transcripts with BLAST
#source "$my_dir/detect_suspect_trans_with_blast.sh"
...
...
@@ -115,7 +106,10 @@ echo
esac
echo
-e
"
\n
Index built :
$out
/
$toolidx
\n
"
#for (( j=0; j <i; j++ ))
### preparing contigs files with transcripts length
refseqALL
=
$out
/ALL_transcripts.ctgs
touch
$refseqALL
for
ref
in
"
${
orders
[@]
}
"
do
refseqs
=
$out
/
$ref
".ctgs"
...
...
@@ -128,24 +122,23 @@ echo
Seqlength = length($2) ;
print a[1]"\t"Seqlength > refseqs
}'
$out
/
$ref
".fasta_mod"
# regroup all samples
echo
-e
"command to create ALL_transcripts.ctgs :
\t
cat
$refseqs
>>
$refseqALL
"
cat
$refseqs
>>
$refseqALL
done
# regroup all samples
refseqALL
=
$out
/ALL_transcripts.ctgs
cat
$out
/
$ref
.ctgs
>
$refseqALL
# mapping successively every read sets on all transcripts.
#for (( k=0; k <i; k++ ))
for
ref
in
"
${
orders
[@]
}
"
do
InfosCtg
=
${
fasta_array
[
$ref
]
}
#reads=${fasta_array[$k]}"_reads"
#fileout=$out/${fasta_array[$k]}"_vs_ALL.out"
reads
=
${
ref
}
"_reads"
fileout
=
$out
/
${
ref
}
"_vs_ALL.out"
finalout
=
$out
/
"ALL_transcripts.all"
#echo -e "\nMapping ${fasta_array[$k]} reads"
echo
-e
"
\n
Mapping
${
ref
}
reads"
echo
-e
"
\n
Info Contigs :
\t
$InfosCtg
\n
Outfile :
\t
$fileout
\n
"
#echo -e "\nInfo Contigs :\t$InfosCtg\nInfo Contigs detailed :\t${InfosCtg[0]};${InfosCtg[1]};${InfosCtg[2]} \
# \nfastq files :\t`echo $InfosCtg | cut -d';' -f2`\t`echo $InfosCtg | cut -d';' -f3` \
# \nOutfile :\t$fileout\nrefseqALL :\t$refseqALL\n"
# calculate expression level with selected tool
case
"
$TOOL
"
in
...
...
@@ -185,11 +178,15 @@ echo
R
)
if
[
$MODE
==
"u"
]
then
#fastq=" -r "$INDIR"/"${fasta_array[$k]}".fastq"
fastq
=
" -r "
$INDIR
"/"
$
{
InfosCtg
[1]
}
fastq
=
" -r "
$INDIR
"/"
`
echo
$InfosCtg
|
cut
-d
';'
-f2
`
else
#fastq=" -1 "$INDIR"/"${fasta_array[$k]}".L.fastq -2 "$INDIR"/"${fasta_array[$k]}".R.fastq"
fastq
=
" -1 "
$INDIR
"/"
$
{
InfosCtg
[1]
}
" -2 "
$INDIR
"/"
$
{
InfosCtg
[2]
}
fastq
=
" -1 "
$INDIR
"/"
`
echo
$InfosCtg
|
cut
-d
';'
-f2
`
" -2 "
$INDIR
"/"
`
echo
$InfosCtg
|
cut
-d
';'
-f3
`
fi
echo
-e
"rapmap quasimap -t
$PROCESSORS
$ADDOPT
-i
$out
/
$toolidx
$fastq
| grep -v "
@
" | cut -f3 |
\
awk -v reads=
$reads
-v refseqs=
$refseqALL
-AWKPART- >
$fileout
\n
"
rapmap quasimap
-t
$PROCESSORS
$ADDOPT
-i
$out
/
$toolidx
$fastq
|
grep
-v
"@"
|
cut
-f3
|
\
awk
-v
reads
=
$reads
-v
refseqs
=
$refseqALL
'BEGIN{OFS="\t"; while ((getline sequ < refseqs) > 0) {split(sequ,a,"\t");ctg[a[1]] = 0; ctgsize[a[1]]= a[2];}; close(refseqs) } {ctg[$1]++}
END{
...
...
@@ -216,6 +213,7 @@ echo
# splitting "All_transcript.all" file into files corresponding to samples
#for (( j=0; j <i; j++ ))
j
=
0
for
ref
in
"
${
orders
[@]
}
"
do
#ref=${fasta_array[$j]}
...
...
@@ -256,6 +254,7 @@ echo
LC_ALL
=
C
grep
-F
-w
-m
$nb
-f
$out
/
$ref
.suspects
$out
/
$ref
.all
>>
$out
/
$ref
".all_suspectonly"
mv
$out
/
$ref
".all"
$out
/
$ref
".all_quants"
;
mv
$out
/
$ref
".all_suspectonly"
$out
/
$ref
".all"
sed
-i
's/ /\t/g'
$out
/
$ref
".all"
j
=
$((
j+1
))
done
# http://www.inmotionhosting.com/support/website/ssh/speed-up-grep-searches-with-lc-all
...
...
src/detect_suspect_trans_with_blast.sh
View file @
95a7ca66
...
...
@@ -42,9 +42,9 @@ done
# regroup all samples
echo
''
>
$out
/ALL_transcripts.fasta
echo
''
>
$out
/ALL_transcripts.suspects
echo
''
>
$out
/ALL_transcripts.fasta_suspects
touch
$out
/ALL_transcripts.fasta
touch
$out
/ALL_transcripts.suspects
touch
$out
/ALL_transcripts.fasta_suspects
for
ref
in
"
${
orders
[@]
}
"
;
do
cat
$out
/
$ref
.fasta_mod
>>
$out
/ALL_transcripts.fasta
...
...
src/detect_suspect_trans_with_blast.sh~
View file @
95a7ca66
...
...
@@ -42,9 +42,9 @@ done
# regroup all samples
echo '' >
$out/ALL_transcripts.fasta
echo '' >
$out/ALL_transcripts.suspects
echo '' >
$out/ALL_transcripts.fasta_suspects
touch
$out/ALL_transcripts.fasta
touch
$out/ALL_transcripts.suspects
touch
$out/ALL_transcripts.fasta_suspects
for ref in "${orders[@]}"; do
cat $out/$ref.fasta_mod >> $out/ALL_transcripts.fasta
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment