-
Notifications
You must be signed in to change notification settings - Fork 0
updated script. Now the path of subscripts is automatically aquired. … #33
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
694291c
updated script. Now the path of subscripts is automatically aquired. …
JannikHamp 3ebb1b8
added some documentation
JannikHamp 7d834a4
added collumn for strand information
JannikHamp 7de9a1b
added column "strand"
JannikHamp 1a49821
documentation
JannikHamp 9b5b061
documentation
JannikHamp 9ecba8a
documentation
JannikHamp 58eff98
documentation
JannikHamp b1cab10
Update compareBed.sh
JannikHamp cca8ac4
Added check for \t at the end of lines in BED-file
renewiegandt f983d22
Remove header = false from fread
renewiegandt 1134d74
merge.R: Set separator from auto to '\t' in fread
renewiegandt 37c69e6
this r script is no more necessary, the other does its job
JannikHamp 6802d72
New updated version. Faster and more robust
JannikHamp b787d14
updated version.. make unique updated, more robust in general
JannikHamp becfeae
added information for logfile
JannikHamp c55e8ff
added dicumentation and parameter for .stats output file
JannikHamp 4acc20f
documentation changes
JannikHamp 90c8c05
updated check for trailing tabs in motiffiles
JannikHamp 1a35ce5
removed echo from testing
JannikHamp 530627c
more documentation, replce =, <-
JannikHamp File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ fa=false | |
mi=false | ||
ma=false | ||
ou=false | ||
pa=false | ||
he=false | ||
|
||
if [ $# -eq 0 ] | ||
|
@@ -70,6 +71,7 @@ case $key in | |
;; | ||
-p|--path) | ||
path="$2" | ||
pa=true | ||
shift | ||
shift | ||
;; | ||
|
@@ -120,6 +122,7 @@ then | |
echo " -max --max maximum size of footprints; default is 80" | ||
echo " -o --output output path/file ; default dir is workdir and filename is newMotifs.bed and newMotifs.bed.fasta" | ||
echo " -h --help shows this help message" | ||
echo " -p --path the path where the required scripts merge.R and maxScore.R are stored. Default: same path as this scripts path" | ||
exit 0 | ||
fi | ||
|
||
|
@@ -133,6 +136,7 @@ echo min: $mi | |
echo max: $ma | ||
echo output: $ou | ||
echo help: $he | ||
echo path of scripts: $pa | ||
|
||
if [ $da == false ] || [ $mo == false ] || [ $fa == false ] | ||
then | ||
|
@@ -143,12 +147,8 @@ fi | |
|
||
if [ $wo == false ] | ||
then | ||
#if [ ! -d workdir1337 ] | ||
#then | ||
# mkdir workdir1337 | ||
#fi | ||
wo=true | ||
workdir=$path | ||
workdir=$PWD | ||
fi | ||
|
||
if [ $ou == false ] | ||
|
@@ -169,9 +169,10 @@ then | |
ma=true | ||
fi | ||
|
||
if [ ! -d $workdir ] | ||
if [ $pa == false ] | ||
then | ||
mkdir $workdir | ||
path=`echo $0 | sed 's/\/[^\/]*$/\//g'` | ||
pa=true | ||
fi | ||
|
||
#1. first filter. no overlap vs. overlap | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Filter for sequences without overlap" would be a nicer comment. |
||
|
@@ -268,8 +269,5 @@ fi | |
Rscript --vanilla $path/merge.R $min $max $workdir $data | ||
|
||
#5. add fasta sequences to bed and create fasta file | ||
bedtools getfasta -fi $fasta -bed "$workdir"/merged.bed -bedOut > $output | ||
bedtools getfasta -fi $fasta -bed $workdir/merged.bed -bedOut > $output | ||
bedtools getfasta -name -fi $fasta -bed "$output" -fo "$output".fasta | ||
|
||
#6 clean up | ||
#rm "$workdir"/pass1Fa.bed "$workdir"/pass1Tr.bed "$workdir"/pass2Tr.bed "$workdir"/merged.bed "$workdir"/pass1FaHelp.bed "$workdir"/pass1TrHelp.bed |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should set $workdir in the beginning to './' and overwrite it if necessary. This would save you this whole if statement + an additional $wo variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking a bit further I think that most if not all of your if statements in this part are overcomplicated. You should set default values at the beginning of your script. This would enable you to discard most of the if statements and leave you only with the required parameters. These should be checked for their existence or in other words whether they were set (https://stackoverflow.com/questions/3601515/how-to-check-if-a-variable-is-set-in-bash).