Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
magatt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UMR GDEC
magatt
Commits
2e92a9f9
Commit
2e92a9f9
authored
4 years ago
by
Helene Rimbert
Browse files
Options
Downloads
Patches
Plain Diff
NEW script to recalc coords of rescue with gmap
parent
e64475d7
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/recalcGmapRescue.sh
+66
-0
66 additions, 0 deletions
bin/recalcGmapRescue.sh
with
66 additions
and
0 deletions
bin/recalcGmapRescue.sh
0 → 100644
+
66
−
0
View file @
2e92a9f9
#!/bin/bash
##SBATCH --array=0-7
##SBATCH -n1
##SBATCH --mail-user=helene.rimbert@inrae.fr
##SBATCH --mail-type=ALL
# for use with slurm
#chroms=($(echo TraesCS{1..7} TraesCSU))
#chrom=${chroms[$SLURM_ARRAY_TASK_ID]}
# get the list of query and target file for gmap
inputDir
=
$1
blastdb
=
$2
querylist
=(
$(
find
$inputDir
-type
f
-name
'gmap.target.gff3'
)
)
numquery
=
${#
querylist
[@]
}
echo
"STARTING AT
`
date
`
FOR DATASET
$inputDir
"
echo
"found
$numquery
query file"
for
i
in
"
${
querylist
[@]
}
"
;
do
rootdir
=
`
dirname
$i
`
# extract the name of the gene
geneid
=
$(
cat
$rootdir
'/query.fasta'
|fgrep
'>'
|perl
-ne
'print $1 if /^\>(TraesCS.+)\ coords/'
)
echo
"
\n\n
================================================"
echo
" gene is
$geneid
"
echo
" datadir is
$rootdir
"
# extract the target chrom, start and stop
chrom
=
$(
fgrep
'>'
$rootdir
'/target.fasta'
|sed
"s/>//"
|cut
-d
' '
-f1
|cut
-d
'_'
-f2
)
start
=
$(
fgrep
'>'
$rootdir
'/target.fasta'
|sed
"s/>//"
|cut
-d
' '
-f1
|cut
-d
'_'
-f3
)
stop
=
$(
fgrep
'>'
$rootdir
'/target.fasta'
|sed
"s/>//"
|cut
-d
' '
-f1
|cut
-d
'_'
-f4
)
echo
" Target coords:
$chrom
from
$start
-
$stop
"
# check the status of the CDS: OK or CHANGED
mappingStatus
=
'UNMAPPED'
if
[
-f
"
$rootdir
/CDS_OK"
]
then
echo
" CDS has not changed between target and reference"
mappingStatus
=
'CDS_OK'
elif
[
-f
"
$rootdir
/CDS_CHANGED"
]
then
echo
" WARNING : CDS has changed between target and reference"
mappingStatus
=
'CDS_CHANGED'
else
echo
" Assume gene is unmapped"
echo
" need to run gmap on entire genome"
mappingStatus
=
'UNMAPPED'
#touch $rootdir/UNMAPPED
continue
fi
echo
" 1. convert gmap coordinates on new reference"
eval
$TRANSFERTANNOT_PATH
'/bin/convertGmapCoords.py'
-G
$rootdir
'/gmap.target.gff3'
-s
$start
-e
$stop
-c
$mappingStatus
-o
$rootdir
'/recalc.gff3'
-r
$chrom
-g
$geneid
-m
GMAP_on_target &>
$rootdir
'/recalc.log'
echo
" 2. sort gff"
eval
gt gff3
-sort
-retainids
-tidy
$rootdir
'/recalc.gff3'
1>
$rootdir
'/recalc_clean.gff3'
done
echo
"ENDED AT
`
date
`
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment