Bug fix scenario in which the script is run standalone to tolerate missing environment variable or missing sample id in file path.