Adding /bin directory within distribution of PATH

159 views
Skip to first unread message

Parnal Sinha

unread,
Oct 19, 2020, 10:34:43 AM10/19/20
to Circos
Hello, 

I seem to be having problems adding the bin/ directory in the distribution of my PATH so that I can run bin/circos from anywhere. Currently, I can only run the specified flags within the bin directory. I have tried to follow what has been specified under 0.7 - Runtime Parameters of the tutorials under "Running Circos" where it specified how to set up the path to run circos anywhere under "Unix" but this is the response from my terminal:

"(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ export PATH=~/software/circos/current/bin:$PATH

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$  . ~/.bash_profile

(base) Parnals-MacBook-Pro-2:~ parnalsinha$ echo $PATH

/Users/parnalsinha/software/circos/current/bin:/Users/parnalsinha/software/circos/current/bin:/Users/parnalsinha/miniconda3/bin:/Users/parnalsinha/miniconda3/bin:/Users/parnalsinha/miniconda3/bin:/Users/parnalsinha/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

(base) Parnals-MacBook-Pro-2:~ parnalsinha$ which circos

(base) Parnals-MacBook-Pro-2:~ parnalsinha$ "

Nothing shows up for "which circos" - how can I rectify this problem? 

Thank you for any help on this situation. 

PS

Parnal Sinha

unread,
Oct 19, 2020, 11:07:18 AM10/19/20
to Circos
Clarification: 
The instructions were under 0.2 - Distribution and Installation; here is the exact instructions: 

RUNNING CIRCOS

Circos uses command-line flags, which are required. In the very least, you need to specify the image configuration file using -conf.

These flags in described in the Runtime Parameters tutorial.

UNIX

It's a good idea to add the bin/ directory in the distribution to your PATH so that you can run bin/circos from anywhere.

Assuming you have Circos in ROOT=~/software/circos/current as described above, append this to your ~/.bashrc or ~/.bash_profile.

export PATH=~/software/circos/current/bin:$PATH

You'll need to explicitly execute either ~/.bashrc or ~/.bash_profile for this to take effect

> . ~/.bashrc # or > . ~/.bash_profile

Finally, test that your PATH has been modified,

> cd ~ > echo $PATH ~/software/circos/current/bin: ... > which circos ~/software/circos/current/bin/circos

Wayne

unread,
Oct 19, 2020, 10:13:04 PM10/19/20
to Circos
What does running the following show you?

ls /Users/parnalsinha/software/circos/current/

I ask because you appear to have successfully added that to your path. But is that really where the circos `bin` is found?
In case it comes up, what version of the OSX are you running? And what shell? I'd guess since you successfully added things to your path in that session that you aren't using the current Mac default, zsh shell, right? (For future troubleshooters finding this, see https://stackoverflow.com/questions/56784894/macos-catalina-10-15beta-why-is-bash-profile-not-sourced-by-my-shell and https://coolestguidesontheplanet.com/how-to-add-to-the-shell-path-in-macos-using-terminal/  if you aren't aware bash shell is no longer the default shell and you need to deal with zsh or go other routes.)

Parnal Sinha

unread,
Oct 19, 2020, 10:53:14 PM10/19/20
to Circos
Hello Wayne, 

Thank you for the response and the information - just a quick summary, when I run the first line I get this: 

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ ls /Users/parnalsinha/software/circos/current/

ls: /Users/parnalsinha/software/circos/current/: No such file or directory


Furthermore, the version of OSX is 10.15.2 - is OSX Catalina. Finally, would the problem lie with using bash instead of zsh shell? I haven't changed to zsh and have been using bash shell since I assumed circos works only with bash. 

Any input on this would be great - if not I will look through the sites you have mentioned. 


PS


Wayne

unread,
Oct 20, 2020, 12:15:18 AM10/20/20
to Circos
The problem is that where you seem to have pointed your PATH at doesn't contain circos.

If `ls /Users/parnalsinha/software/circos/current/` didn't show you circos bin then your circos files aren't where you are pointing your path and therefore `which circos` isn't going to find circos.

In the instructions you referenced, it says "Assuming you have Circos in ROOT=~/software/circos/current as described above, append this to your ~/.bashrc or ~/.bash_profile." But apparently that isn't the location you installed to? So you need to edit the path to be the path on your computer. Do you recall the directory you installed Circos into? And remember before adding a path to your bash profile, you can test you've got the correct path using  `ls` followed by the absolute path and you should see it list the circos files. You don't want to see it return `No such file or directory`.  If you figure it out, you probably should post back here so others can learn from this.

You are right to be using Bash shell to make it easier to match up with the Circos directions and so there is no need for you to look at any of those links.

Parnal Sinha

unread,
Oct 20, 2020, 12:58:24 PM10/20/20
to Circos
Hello Wayne, 

Thank you very much for the info. I specified my file path and I'm certain I have fixed it as all three tests (echo PATH, which circos & ls) have worked perfectly. Yet, I still have trouble running the specified flags and an error pops up whenever I try to run the circos flags. Furthermore, the flag "no such file or directory" pops up whenever I try to run the flags. 

"

(circos) Parnals-MacBook-Pro-2:current parnalsinha$ cd 

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ export PATH=~/Applications/circos/current/bin/:$PATH

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$  . ~/.bashrc

-bash: /Users/parnalsinha/.bashrc: No such file or directory

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$  . ~/.bash_profile

(base) Parnals-MacBook-Pro-2:~ parnalsinha$ conda activate circos

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ echo $PATH

/Users/parnalsinha/Applications/circos/current/bin:/Users/parnalsinha/miniconda3/envs/circos/bin:/Users/parnalsinha/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ which circos

/Users/parnalsinha/Applications/circos/current/bin/circos

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ ls /Users/parnalsinha/Applications/circos/current

CHANGES README.windows example

CITATION SUPPORT fonts

INSTALL TODO gddiag.png

LICENSE bin lib

README data tiles

README.tools error

README.tutorials etc

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ which circos

/Users/parnalsinha/Applications/circos/current/bin/circos

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ echo $PATH

/Users/parnalsinha/Applications/circos/current/bin:/Users/parnalsinha/miniconda3/envs/circos/bin:/Users/parnalsinha/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

"


^The above is the solution - I ensured that my file path is concurrent to the location where circos was installed for me.  


The following is the error which pops up for me regardless after the path has been fixed: 

"

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ cd Applications/circos/current/e

error/   etc/     example/ 

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ cd Applications/circos/current/example/

(circos) Parnals-MacBook-Pro-2:example parnalsinha$ ./run

Creating image circos.png and writing report to run.out.

Example takes ~45-60 seconds to generate.

 at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Error.pm line 425.

Circos::Error::fatal_error('font', 'no_ttf', '/Users/parnalsinha/Applications/circos/circos-0.69-9/example/...') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Font.pm line 192

Circos::Font::get_label_size('font_file', '/Users/parnalsinha/Applications/circos/circos-0.69-9/example/...', 'size', 10, 'text', 'abc123') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Font.pm line 243

Circos::Font::sanity_check() called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos.pm line 726

Circos::run('Circos', '_argv', '-conf etc/circos.conf -debug_group summary,timer', 'debug_group', 'summary,timer', '_cwd', '/Users/parnalsinha/Applications/circos/current/example', 'configfile', 'etc/circos.conf', ...) called at ../bin/circos line 536

(circos) Parnals-MacBook-Pro-2:example parnalsinha$ cd ..

(circos) Parnals-MacBook-Pro-2:current parnalsinha$ ./circos -debug

-bash: ./circos: No such file or directory

(circos) Parnals-MacBook-Pro-2:current parnalsinha$ cd


"


I'm a little confused as to what is going wrong - all my files and GD is compiled correctly:

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ cd Applications/circos/current/bin

(circos) Parnals-MacBook-Pro-2:bin parnalsinha$ ./circos -modules

ok       1.29 Carp

ok       0.36 Clone

ok       2.63 Config::General

ok       3.40 Cwd

ok      2.145 Data::Dumper

ok       2.52 Digest::MD5

ok       2.84 File::Basename

ok       3.40 File::Spec::Functions

ok       0.23 File::Temp

ok       1.51 FindBin

ok       0.39 Font::TTF::Font

ok       2.46 GD

ok        0.2 GD::Polyline

ok       2.39 Getopt::Long

ok       1.16 IO::File

ok       0.33 List::MoreUtils

ok       1.38 List::Util

ok       0.01 Math::Bezier

ok      1.998 Math::BigFloat

ok       0.06 Math::Round

ok       0.08 Math::VecStat

ok       1.03 Memoize

ok       1.32 POSIX

ok       1.08 Params::Validate

ok       1.61 Pod::Usage

ok       2.05 Readonly

ok 2013031301 Regexp::Common

ok       2.85 SVG

ok       1.19 Set::IntSpan

ok     1.6611 Statistics::Basic

ok       2.41 Storable

ok       1.17 Sys::Hostname

ok       2.02 Text::Balanced

ok       0.61 Text::Format

ok     1.9725 Time::HiRes

(circos) Parnals-MacBook-Pro-2:bin parnalsinha$ "

Any help on this? 

Parnal Sinha

unread,
Oct 20, 2020, 1:14:44 PM10/20/20
to Circos
Clarifications - fixing the file path ensured all the flags were working properly - still the issue of not being able to run the example file...  :(

"

(circos) Parnals-MacBook-Pro-2:example parnalsinha$ ../bin/circos -conf ./circos.conf

debuggroup summary 0.16s welcome to circos v0.69-8 15 Jun 2019 on Perl 5.018004

debuggroup summary 0.17s current working directory /Users/parnalsinha/Applications/circos/current/example

debuggroup summary 0.17s command ../bin/circos -conf ./circos.conf

debuggroup summary 0.17s loading configuration from file ./circos.conf


  *** CIRCOS ERROR ***


      cwd: /Users/parnalsinha/Applications/circos/current/example


      command: ../bin/circos -conf ./circos.conf


  CONFIGURATION FILE ERROR


  Circos could not find the configuration file [./circos.conf]. To run Circos,

  you need to specify this file using the -conf flag. The configuration file

  contains all the parameters that define the image, including input files,

  image size, formatting, etc.


  If you do not use the -conf flag, Circos will attempt to look for a file

  circos.conf in several reasonable places such as . etc/ ../etc


  To see where Circos looks for the file, use


      circos -debug_flag io


  To see how configuration files work, create the example image, whose

  configuration and data are found in example/. From the Circos distribution

  directory,


      cd example


      ../bin/circos -conf ./circos.conf


  or use the 'run' script (UNIX only).


  Configuration files are described here


      http://circos.ca/tutorials/lessons/configuration/configuration_files/


  and the use of command-line flags, such as -conf, is described here


      http://circos.ca/tutorials/lessons/configuration/runtime_parameters/


  Windows users unfamiliar with Perl should read


      http://circos.ca/tutorials/lessons/configuration/unix_vs_windows/


  This error can also be produced if supporting configuration files, such as

  track defaults, cannot be read.


  If you are having trouble debugging this error, first read the best practices

  tutorial for helpful tips that address many common problems


      http://www.circos.ca/documentation/tutorials/reference/best_practices


  The debugging facility is helpful to figure out what's happening under the

  hood


      http://www.circos.ca/documentation/tutorials/configuration/debugging


  If you're still stumped, get support in the Circos Google Group.


      http://groups.google.com/group/circos-data-visualization


  Please include this error, all your configuration, data files and the version

  of Circos you're running (circos -v). Do not email me directly -- please use

  the group.


  Stack trace:

 at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Error.pm line 425.

Circos::Error::fatal_error('configuration', 'missing', './circos.conf') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Configuration.pm line 796

Circos::Configuration::loadconfiguration('./circos.conf') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos.pm line 148

Circos::run('Circos', '_cwd', '/Users/parnalsinha/Applications/circos/current/example', 'configfile', './circos.conf', '_argv', '-conf ./circos.conf') called at ../bin/circos line 536

Wayne

unread,
Oct 20, 2020, 2:22:46 PM10/20/20
to Circos
Where are getting the directions to run the example?

According to http://circos.ca/support/getting_started/ you can either run either of the following THREE commands from inside the `example` directory:
./run
../bin/circos -conf etc/circos.conf
../bin/circos

None of which match what you are trying.

This also matches what you see if you go to https://github.com/fomightez/circos-binder and click on `launch Circos on Jupyter` and select the first item in the list that will come up after the session launches, namely 'Getting Circos Up and Running'. I just tested all three commands I listed above and they work there.

What prints out when you have an error, specifically `command: ../bin/circos -conf ./circos.conf` probably pre-dates Martin rearranging the example layout. (Guessing there.) However, it is always best to look at the most thorough documentation at the Circos site itself.

Parnal Sinha

unread,
Oct 20, 2020, 3:53:59 PM10/20/20
to Circos
Hello Wayne, 

Thank you very much for the prompt responses. Firstly, I just used the example from the error message displayed when I ran the initial input of ./run - I hadn't displayed it but here is the error I got from ./run in the example directory: 


"
*** CIRCOS ERROR ***


      cwd: /Users/parnalsinha/Applications/circos/current/example

...

 To see how configuration files work, create the example image, whose

  configuration and data are found in example/. From the Circos distribution

  directory,


      cd example


      ../bin/circos -conf ./circos.conf


  or use the 'run' script (UNIX only).

"


I ran the above 3 commands and this was the stack trace and error message: 

"

(circos) Parnals-MacBook-Pro-2:example parnalsinha$ ./run

Creating image circos.png and writing report to run.out.

Example takes ~45-60 seconds to generate.

 at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Error.pm line 425.

Circos::Error::fatal_error('font', 'no_ttf', '/Users/parnalsinha/Applications/circos/circos-0.69-9/example/...') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Font.pm line 192

Circos::Font::get_label_size('font_file', '/Users/parnalsinha/Applications/circos/circos-0.69-9/example/...', 'size', 10, 'text', 'abc123') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Font.pm line 243

Circos::Font::sanity_check() called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos.pm line 726

Circos::run('Circos', 'configfile', 'etc/circos.conf', 'debug_group', 'summary,timer', '_argv', '-conf etc/circos.conf -debug_group summary,timer', '_cwd', '/Users/parnalsinha/Applications/circos/current/example', ...) called at ../bin/circos line 536

(circos) Parnals-MacBook-Pro-2:example parnalsinha$ ../bin/circos -conf etc/circos.conf

debuggroup summary 0.15s welcome to circos v0.69-8 15 Jun 2019 on Perl 5.018004

debuggroup summary 0.16s current working directory /Users/parnalsinha/Applications/circos/current/example

debuggroup summary 0.16s command ../bin/circos -conf etc/circos.conf

debuggroup summary 0.16s loading configuration from file etc/circos.conf

debuggroup summary 0.16s found conf file etc/circos.conf

debuggroup summary 0.44s debug will appear for these features: output,summary

debuggroup summary 0.44s bitmap output image ./circos.png

debuggroup summary 0.44s SVG output image ./circos.svg

debuggroup summary 0.44s parsing karyotype and organizing ideograms

debuggroup summary 0.61s karyotype has 66 chromosomes of total size 8,540,079,869

debuggroup summary 0.62s applying global and local scaling

debuggroup summary 0.71s allocating image, colors and brushes


  *** CIRCOS ERROR ***


      cwd: /Users/parnalsinha/Applications/circos/current/example


      command: ../bin/circos -conf etc/circos.conf


  There was a problem with True Type font support. Circos could not render text

  from the font file


      /Users/parnalsinha/Applications/circos/circos-0.69-9/example/../fonts/modern/cmuntt.ttf


  Please check that gd (system graphics library) and GD (Perl's interface to gd)

  are compiled with True Type support.


  On UNIX systems, try


      gdlib-config --all


  and look for GD_FREETYPE in the 'features' line and -lfreetype in the 'libs'

  line. If these are there, it's likely that your Perl GD module needs

  recompiling.


  For help in installing libgd and/or GD, see


      http://www.perlmonks.org/?node_id=621579


  If you are having trouble debugging this error, first read the best practices

  tutorial for helpful tips that address many common problems


      http://www.circos.ca/documentation/tutorials/reference/best_practices


  The debugging facility is helpful to figure out what's happening under the

  hood


      http://www.circos.ca/documentation/tutorials/configuration/debugging


  If you're still stumped, get support in the Circos Google Group.


      http://groups.google.com/group/circos-data-visualization


  Please include this error, all your configuration, data files and the version

  of Circos you're running (circos -v). Do not email me directly -- please use

  the group.


  Stack trace:

 at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Error.pm line 425.

Circos::Error::fatal_error('font', 'no_ttf', '/Users/parnalsinha/Applications/circos/circos-0.69-9/example/...') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Font.pm line 192

Circos::Font::get_label_size('font_file', '/Users/parnalsinha/Applications/circos/circos-0.69-9/example/...', 'size', 10, 'text', 'abc123') called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos/Font.pm line 243

Circos::Font::sanity_check() called at /Users/parnalsinha/Applications/circos/circos-0.69-9/bin/../lib/Circos.pm line 726

Circos::run('Circos', '_cwd', '/Users/parnalsinha/Applications/circos/current/example', 'configfile', 'etc/circos.conf', '_argv', '-conf etc/circos.conf') called at ../bin/circos line 536

"

The same error occurred with the other three fonts. I tried to compile True Type and nothing out of the ordinary showed up which ought to have showed up:

"

(circos) Parnals-MacBook-Pro-2:current parnalsinha$ gdlib-config --all

GD library  2.0.33

includedir: /usr/local/include

cflags:     -I/usr/local/include

ldflags:     -L/usr/local/lib 

libs:       -ljpeg -lpng -lz  -liconv

libdir:     /usr/local/lib

features:   GD_JPEG GD_PNG GD_GIF

(circos) Parnals-MacBook-Pro-2:current parnalsinha$ 

...

  On UNIX systems, try


      gdlib-config --all


  and look for GD_FREETYPE in the 'features' line and -lfreetype in the 'libs'

  line. If these are there, it's likely that your Perl GD module needs

  recompiling.

"

Thank you so much for all the help thus far - I sincerely appreciate all the help. 


PS


Wayne

unread,
Oct 20, 2020, 4:16:36 PM10/20/20
to Circos
Glad to see following the documentation on the Circos site, you got the example job running. Or at least starting up to run.

However, I cannot help you fix this True Type font support. issue. You've reached the limit of what I can help you with because I don't run this on a Mac. 
I'd encourage you to look at all the references you see and look around for more current help related to your Max OSX about this, too. Have you searched the Circos Google group for this?
If you still haven't made and progress, then I'd suggest you start a new forum question about it. It will get buried in here because you've dealt with the issue you posted about here already.

Parnal Sinha

unread,
Oct 20, 2020, 9:12:48 PM10/20/20
to Circos
Thank you very much for all the help regardless - I looked up some conversations but they all led to "recompile GD" - I'll continue to search and if not post about it. 

Again, thanks for the info - quickly on the solution for future users: 

If the path is off, circos flags will not work on terminal - the solution and problem are detailed above and the solutions been pasted here:

I specified my file path and I'm certain I have fixed it as all three tests (echo PATH, which circos & ls) have worked perfectly. Yet, I still have trouble running the specified flags and an error pops up whenever I try to run the circos flags. Furthermore, the flag "no such file or directory" pops up whenever I try to run the flags. 

"

(circos) Parnals-MacBook-Pro-2:current parnalsinha$ cd 

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ export PATH=~/Applications/circos/current/bin/:$PATH

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$  . ~/.bashrc

-bash: /Users/parnalsinha/.bashrc: No such file or directory

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$  . ~/.bash_profile

(base) Parnals-MacBook-Pro-2:~ parnalsinha$ conda activate circos

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ echo $PATH

/Users/parnalsinha/Applications/circos/current/bin:/Users/parnalsinha/miniconda3/envs/circos/bin:/Users/parnalsinha/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ which circos

/Users/parnalsinha/Applications/circos/current/bin/circos

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ ls /Users/parnalsinha/Applications/circos/current

CHANGES README.windows example

CITATION SUPPORT fonts

INSTALL TODO gddiag.png

LICENSE bin lib

README data tiles

README.tools error

README.tutorials etc

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ which circos

/Users/parnalsinha/Applications/circos/current/bin/circos

(circos) Parnals-MacBook-Pro-2:~ parnalsinha$ echo $PATH

/Users/parnalsinha/Applications/circos/current/bin:/Users/parnalsinha/miniconda3/envs/circos/bin:/Users/parnalsinha/miniconda3/condabin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin

"

^The above is the solution - I ensured that my file path is concurrent to the location where circos was installed for me.  


PS


Reply all
Reply to author
Forward
0 new messages