Hi all, I think I have fallen over the same problem Glen Beane reported in Nov 2010, http://lists.bx.psu.edu/pipermail/galaxy-dev/2010-November/003943.html I recall from reading the mailing list, that when you import a BAM file into Galaxy, it gets sorted and indexed. That makes sense since most tools need that to be done, and resorting an already sorted file should be quick. However, I'm trying to import some presorted and indexed BAM files into a library in Galaxy via the Admin settings, linking to the file not copying it. I'm getting this: <quote> File size: 4.4 Gb Data type: auto Build: ? Miscellaneous information: uploaded bam fileTraceback (most recent call last): File "/opt/galaxy-dist/tools/data_source/upload.py", line 447, in __main__() File "/opt/galaxy-dist/tools/data_source/upload.py", line 439, in __main__ add_file( dataset, registry, j Job Standard Output [bam_sort_core] merging from 28 files... Job Standard Error Traceback (most recent call last): File "/opt/galaxy-dist/tools/data_source/upload.py", line 447, in __main__() File "/opt/galaxy-dist/tools/data_source/upload.py", line 439, in __main__ add_file( dataset, registry, json_file, output_path ) File "/opt/galaxy-dist/tools/data_source/upload.py", line 381, in add_file datatype.groom_dataset_content( output_path ) File "/opt/galaxy-dist/lib/galaxy/datatypes/binary.py", line 98, in groom_dataset_content shutil.move( samtools_created_sorted_file_name, file_name ) File "/usr/local/lib/python2.6/shutil.py", line 260, in move copy2(src, real_dst) File "/usr/local/lib/python2.6/shutil.py", line 95, in copy2 copyfile(src, dst) File "/usr/local/lib/python2.6/shutil.py", line 51, in copyfile with open(dst, 'wb') as fdst: IOError: [Errno 13] Permission denied: '/data/XXX-bwa-out.sorted.bam' error Database/Build: ? Number of data lines: None Disk file: /data/XXX-bwa-out.sorted.bam </quote> Clearly from the error message, Galaxy is trying to edit the source file (and the Unix account it is running in only has read permission for this file and its containing folder). From the stdout message "[bam_sort_core] merging from 28 files..." it looks like Galaxy is trying to (re)sort my file, and may well attempt to reindex it. Is that likely to be the case? If the "copy" option had been used, then sorting and indexing should work - but I want Galaxy to link to the file as it it. If however "copy" was not selected, then I don't want Galaxy trying to alter the file like this. Could the sort+index be disabled in this mode? I think it is reasonable to expect administrators trying to import BAM files from the local file system to take care of this. Alternatively, you could actually check if the BAM file is pre-sorted or not. Peter