add `shell.prefix()` in snakemake profile? - snakemake

For using conda activate myenv inside a script rule, I should add
shell.prefix("source /usr/local/genome/Anaconda3/etc/profile.d/conda.sh;")
at the beginning of the Snakefile.
I would like to add this option in my profile. For example in config.yaml or in sge-submit.py.
I tried to add it in sge-jobscript.sh, but it doesn't seem to work.
Is there a solution for this ? Do you have the same problem ?
Thanks in advance

I think you should be able to add a prefix variable to your config.yaml:
prefix: "source /usr/local/genome/Anaconda3/etc/profile.d/conda.sh;"
and then in your snakefile:
shell.prefix(config["prefix"])

Related

Anaconda won't activate virtual environment

I know similar problems have already been adressed, but I just couldn't find the solution in the previous answers that were given...
So here's the thing : I created an environment using
conda create -n djangodev pyhton=3.4
I checked, and the folder is created in \Anaconda3\envs but when I want to activate it :
activate djangodev
I get :
File "<ipython-input-71-d6d1f1bb5b1c>", line 1
activate djangodev
^
SyntaxError: invalid syntax
So I really don't know what to do. I tried changing the path but I couldn't find how to do it properly, as all the ways I've tried didn't work.
Could you help me please ?
Thanks !

Phinx path with subfolders

i want to have a better overview on the phinx migration files. i want something like this
/db/migration/1.8.5/ID-2065/my_file_name_1234567890
So i can use
'migrations' => '%%PHINX_CONFIG_DIR%%/db/migrations/'. $_ENV['APP_VERSION'],
In the docs only is something like this
migrations: %%PHINX_CONFIG_DIR%%/module/*/{data,scripts}/migrations
But how can i use there maybe a param from the command line.
See you
If your using the default YAML based configuration you can try using Phinx ENV vars (PHINX_ prefix) and then use a %%PHINX_VARNAME%% replacement. Note: I haven't actually tried this before. Read more about them here: http://docs.phinx.org/en/latest/configuration.html#external-variables
Otherwise if your using a PHP-based configuration file you can definitely access the $_ENV superglobal as you have described. Just be sure to call your bootstrap/init scripts so your application version is injected.
Rob

Appcelerator Module titanium.py

I'm a new Mac user and i don't anderstand the way to create the titanium.py
http://docs.appcelerator.com/titanium/3.0/#!/guide/Legacy_Command-Line_Interface-section-29004835_LegacyCommand-LineInterface-OSX
how can i create a bash_profil, and where must i set up those links ?
alias titanium.py="/Library/Application\ Support/Titanium/mobilesdk/osx//titanium.py"
alias ios_builder="/Library/Application\ Support/Titanium/mobilesdk/osx//iphone/builder.py"
Can anybody teach me step by step :/ ?
Thx !
The problem was in the module configuration path to titanium.py have to add $HOME before /library and it works...
this is my .bash_profile :
titanium.py
alias titanium.py='~/Library/Application\ Support/Titanium/mobilesdk/osx/3.5.1.GA/titanium.py'
ios_builder
alias ios_builder='~/Library/Application\ Support/Titanium/mobilesdk/osx/3.5.1.GA/iphone/builder.py'

How do you run a Yii command from within your Module?

Is it possible to have my module's custom commands show up in the list of application commands when you run yiic?
cd {yii_protected_folder}
yiic shell {full_path_to_my_yii_protected_folder}/config/console.php
I've tried adding the command into the commandMap array in console.php, but the command never shows up as an option in yiic.
'commandMap'=>array(
'passwordtest'=>array(
'class'=>'application.modules.myModule.commands.shell.passwordtestCommand',
),
The only way I can make it show up in yiic is to copy the passwordtestCommand.php file to {yii_protected_folder}/commands/shell/, but I'd rather keep the file within my module and reference it somehow.
It's actually not that hard, the CConsoleApplication-class has a getter for the CConsoleCommandRunner. This in its turn has an "addCommands()"-function that allows you to add paths. Just open up your protected/yiic.php and change it by this:
<?php
defined('STDIN') or define('STDIN', fopen('php://stdin', 'r'));
defined('YII_DEBUG') or define('YII_DEBUG',true);
require_once(dirname(__FILE__).'/../yii/yii.php');
$app = Yii::createConsoleApplication(dirname(__FILE__).'/config/console.php');
$app->commandRunner->addCommands('extraCommandPath');
$app->commandRunner->addCommands('extraCommandPath2');
$app->run();
After that you no longer require the yiic.php from the framework.
That should do it.
'commandMap'=>array(
'passwordtest'=>array(
'class'=>'application.modules.myModule.commands.shell.passwordtestCommand',
),
this help me with run module command in Yii 1.x
just add it into config/console.php or your different console config file.
also change the path part ".myModule.commands.shell.passwordtestCommand"
cheer, it's working for me.

output_path not working in behat 2.4.0?

I'm experiencing problems with HTML formatter and the output_path in behat. I'm using cmd:
behat --format=html --out=output.html --config /www/config/behat.yml test.feature
Simplified config (behat.yml) looks like this:
default:
formatter:
name: html
parameters:
output_path: /www/features/output
The problem is that no matter what output_path I set, the output.html is always placed inside same directory, where is behat.yml (/www/config). Can anybody see what am I doing wrong?
Thanks a lot for help!
UPDATE Behat v 2.4.3 use the output dir same as current dir (not the same as config), but still output_path parameter in behat.yml seems not working.
consider using the command line args and see if the issue still happens
for example:
/bin/behat --config=/pathToYML -f pretty,progress,junit --out path/to/output/file/for/pretty,,path/to/junit/output/file /path/to/behat/features/folder
The command line stuff seems to want all three if you don't specify something it will output to console which is why there are , , between pretty and path
This could hold a clue as to why you are having a problem if the command line wants more than one option by default you might need to configure your yaml for that as well.
Our shell script just feeds the command line what we want dynamically instead of doing guess work with yaml configs. Good luck
I had the same issue with behat 2.4.0, this was a known bug that was fixed on version 2.4.3.
Installation method #2 (PHAR) in the guide unfortunately only gives you version 2.4.0 at the time of writting... So in order to fix this you'll have to use the composer method #1.
Hope that helps!